# A Traceable Blockchain-Based Vaccination Record Storage and Sharing System

Authors: Jingshou Chen; Xiaofeng Chen; Chin-Ling Chen
Journal: Journal of Healthcare Engineering
 (2022)

---

## Abstract

Blockchain technology is essentially a decentralized database maintained by relevant parties and has been widely used in various scenarios such as logistics and finance. In terms of applications in the medical field, it is becoming more and more important because the patient's symptoms may be related to a certain vaccine. Whether the patient has been vaccinated with this vaccine will lead to different diagnostic results by the doctor. However, in the current vaccination environment of many regions, the vaccination record (VR) can only be kept in the patient’s vaccination booklet, which is easy to lose or destroy. Therefore, the doctor needs to retrieve the patient’s VR through a centralized database maintained by the government, which is time-consuming and will increase the medical risk. This study proposes a traceable blockchain-based vaccination record storage and sharing system. In the proposed system, the patient gets the vaccination at any legal clinic and the VR can be saved accompanied by the signature into the blockchain center, which ensures traceability. When the patient visits the hospital for treatment, the doctor can obtain the detail of the VR from the blockchain center and then make a diagnosis. The security of the proposed system will be protected by the programmed smart contracts. Through mutual authentication, our system can also provide and guarantee data integrity and nonrepudiation. Moreover, the proposed system has resistance to replay and man-in-the-middle attacks, and the performance is good.


---

## Body

## 1. Introduction

The rapid evolution of information technology is giving more convenience to our daily lives. Electronic health records (EHRs), including medical payment records, medical treatment records, and medical history, are gathered and stored in the private servers of the hospitals [1–5] and now is drawing increasing attention as it contains personal privacy information. For multiple reasons including to improve the quality of services, the traditional paper-based systems have been replaced by the electronic health system for storing and processing EHRs based on a more flexible, more efficient, and more convenient platform.It should be noticed that nowadays in many regions, vaccination recording is still in a traditional way that is not keeping up with developing technologies. The patient can only be vaccinated in a clinic nearby with a vaccine booklet that records the vaccination. The detail of the vaccination record (VR) is stored in the clinic and will be uploaded into a centralized database maintained by the government. Without the vaccine booklet, the patient cannot tell what vaccine he/she has gotten, not to mention the vaccination time and the detailed information of the vaccination phase. Unfortunately, the vaccine booklet has vulnerability to forgery, alteration, and loss. Furthermore, under the current vaccination system, the patient’s VR is not directly shared between the clinic and the hospital. When the patient visits the hospital for treatment of a symptom without the vaccine booklet, and the symptom is related to a certain vaccine (for example, varicella-zoster virus), the hospital cannot directly gain the VR from the clinic but needs to retrieve it through the centralized database. The retrieving phase is very time-consuming and will increase the medical risk [6–10]. Therefore, allowing the patients and the doctors to track and retrieve the VR at any time is an important issue that needs to be resolved in the current stage of research.Meanwhile, the vaccination records (VRs) need to be carefully protected as important privacy information. The centralized database provides a controlled and easy-access solution for maintaining the VRs. However, the security of VRs is bound to be threatened when the failure occurs in the centralized database. Besides, decentralized databases offer another solution for data protection. Compared with the centralized database, the data in the decentralized database are scattered and stored in different places. The collapse of one database will not lead to the failure of all the decentralized databases, so the decentralized databases have better security than the centralized database.How to provide flexible data sharing is another concern in VRs. Centralized databases store the VRs in one place. Although this is convenient for data management, it virtually imposes a heavy burden on the server. As a result, it is not conducive to rapidly sharing the VRs via centralized databases. Decentralized databases can access its different separated databases through different channels, so they can provide efficient VR sharing.Blockchain technology is essentially a decentralized database collectively maintained and has been widely employed in various fields [11–15]. As there is no need for third-party trust endorsements, blockchain can create a fully trusted environment between unfamiliar involved parties. Furthermore, it can ensure traceability, irreparable modification, nonrepudiation, and privacy protection through cryptography technology. Therefore, blockchain technology has been seen as a powerful tool to address the above problems in current vaccination recording systems through its attractive features.Based on the foregoing overview, a blockchain-based vaccination record storage and sharing system is proposed, to provide traceable VRs and support the data sharing of confidential VRs. In our proposed system, the detail of the VR with the signature will be permanently stored in the blockchain center after the vaccination, thereby ensuring the integrity of the data.In detail, the contributions of our study are listed below.(1)
Each role in our blockchain-based vaccination record storage and sharing system is specifically defined. In our method, the traceability and the integrity of VR are guaranteed by blockchain technology.(2)
BAN logic is used to identify the identity to provide communication security between two parties.(3)
Through the characteristics of the blockchain, our system can resist a variety of attacks, i.e., replay attack and man-in-the-middle attack. Meanwhile, the performance of our system is elaborated by the computation cost, communication cost analysis, and functionality comparison.The rest of this study is organized as follows. Section2 reviews related work. In Section 3, the preliminary and security requirements of the proposed system will be briefly introduced. The proposed vaccination record storage and sharing system is described in a detailed way in Section 4. Section 5 and Section 6 show the security and performance analysis of the proposed system, respectively. Section 7 presents our conclusions.


## 2. Related Works

The massive growth of medical data impels traditional medical data management schemes to expose the defects. To overcome the drawbacks and improve the medical services, some medical systems have been proposed [16–24]. The medical systems applying cloud computing have already shown good performance in storing and processing the EHRs between different medical institutions [16, 17]. However, on the one hand, the current cloud-based systems have no superiority in privacy protection for the EHRs; on the other hand, these systems have not achieved a satisfactory data sharing mechanism. Thus, Xia et al. [18] proposed a blockchain-based system for the effective management and protection of medical records in 2017. The security of the storage data is guaranteed by authenticating user identities and using encryption mechanisms. However, the system had the risk of data leakage during the data sharing process, making the system unsuitable for real-world applications. Zheng et al. [19] designed a medical data sharing scheme that combines blockchain and cloud computing. Their scheme realized the sharing of medical data between participating parties. However, the data receiver does not know the correctness of the received data since the integrity of the received medical data cannot be verified. Xia et al. [20] introduced an electronic medical record sharing scheme based on blockchain. The tamper-resistant feature of the blockchain technology is used in their method to ensure the security of the medical records. However, the patient cannot track their EHRs in real time. Later, Yang et al. [21] suggested a blockchain-based EHR system. Although their system has good compatibility with some existing systems, their system is not efficient because the creation and verification of new blocks are all handled by a single party.Although some secure medical systems based on electronic medical records (EMRs) have been proposed in the past, there is not much research on the medical system based on VRs [25–28]. In 2021, Hofstetter et al. [25] introduced a strategy to offer vaccinations in nonprimary care settings such as schools, hospitals, and pharmacies. However, their method can only be used to solve the restriction in the specific clinic. An electronic vaccination certificate (EVC) is developed to replace traditional vaccination record booklets. Yet, EVC is mainly used to record COVID-19 vaccination. Eisenstadt et al. [26] used the EVC as “Immunity Passport” for COVID-19. They designed a smartphone app that connects to a centralized database that can store patients’ vaccination status. Based on that record, the app generates a token or QR (“quick response”) code signifying the vaccination status, which can then be verified by authorized parties. The EVC faces two significant challenges: interoperability and privacy [28]. Since the EVC standards established in different places are not uniform, how to realize cross-regional EVC recognition is important for the broad and easy usability of digital vaccination certificates. Data privacy is important for user trust and legal compliance making it the de facto crucial challenge than interoperability.Based on the existing analysis of research scholars, it is foreseeable that the service quality of the medical systems can be further facilitated with the combination of blockchain technology. On the other side, it cannot be ignored that blockchain-based medical systems still have flaws in the privacy protection of data storage and sharing. Particularly, the electrification of VRs is still under development. How to allow patients to track and grasp their VRs meanwhile realizing the sharing of vaccine records between different institutions is an urgent problem to be solved. These issues are exactly the concerns of this study. In our proposed traceable blockchain-based vaccination record storage and sharing system, every VR is stored in the blockchain through the smart contract and granted secure data sharing in the future. It is visible that our scheme shows the way to fill the gaps of existing research.


## 3. Preliminary and Security Requirements

In this section, the preliminary requirements, including the BAN logic, ECDSA, and the smart contract, are elaborated in subsection3.1. Subsection 3.2 shows the security requirements of the proposed scheme.


### 3.1. Preliminary

#### 3.1.1. BAN Logic

The Burrows-Abadi-Needham (BAN) logic proof model [29] is widely applied in security-related scholars for proving whether the mutual authentication has been achieved of a protocol or scheme.


#### 3.1.2. ECDSA

To guarantee the security of the transmitted and exchanged message in the digital network, several encryption systems have been proposed by scholars. The elliptic curve digital signature algorithm (ECDSA), derived from the digital signature algorithm (DSA) [30], involves the concept of elliptic curve cryptography (ECC) [31]. While compared to DSA, the ECC reduces the key size in the algorithm and also provides a faster calculation speed.


#### 3.1.3. Smart Contract

The smart contract [32] is a computer protocol designed to spread, verify, and execute a contract in a digital form. The promised agreement between each contract participant can be executed on it. The collaboration and trust between each contract participant can be achieved in blockchain through smart contracts, which can expand the cooperation between each party.With the development of medical technology, a large amount of information about patients' vaccination records, medical histories, and medical payment records needs to be reserved. These records are not only stored in the local server but also permanently conserved in the blockchain by the smart contracts. When a patient visits different medical institutions, he/she can authorize medical staff to retrieve the history VR from the BC through the smart contract. Thus, the medical staff can provide better health services with the help of historical medical records.


### 3.2. Security Requirements

The security requirements of our vaccination record storage and sharing system are listed as follows.(1)
Mutual authentication: in a proposed system, each party must confirm the legal identity of other parties in every phase. If any two parties can confirm one another’s legal identity, then mutual authentication is achieved.(2)
Data integrity: in an insecure network environment, the message delivered from the sender may be modified by a malicious attacker. Thus, the integrity of the transferred message must be maintained and should be ensured that it can defend against tampering during the transmission.(3)
Nonrepudiation: in each information exchange phase, the sender cannot refuse to acknowledge that the message he has been sent. A secure system must achieve nonrepudiation requirements.(4)
Resisting replay attacks: the communication between two parties may be intervened by malicious attackers. The malicious attackers will pretend to be a legitimate sender and send identical information to the intended receiver. This situation will lead to the leak of personal data security and, therefore, must be prevented.(5)
Resisting man-in-the-middle attacks: the attacker may intercept the message communicated between the sender and the receiver, and then, he/she can obtain the content of the message in the middle. This situation must be prevented too.


## 3.1. Preliminary

### 3.1.1. BAN Logic

The Burrows-Abadi-Needham (BAN) logic proof model [29] is widely applied in security-related scholars for proving whether the mutual authentication has been achieved of a protocol or scheme.


### 3.1.2. ECDSA

To guarantee the security of the transmitted and exchanged message in the digital network, several encryption systems have been proposed by scholars. The elliptic curve digital signature algorithm (ECDSA), derived from the digital signature algorithm (DSA) [30], involves the concept of elliptic curve cryptography (ECC) [31]. While compared to DSA, the ECC reduces the key size in the algorithm and also provides a faster calculation speed.


### 3.1.3. Smart Contract

The smart contract [32] is a computer protocol designed to spread, verify, and execute a contract in a digital form. The promised agreement between each contract participant can be executed on it. The collaboration and trust between each contract participant can be achieved in blockchain through smart contracts, which can expand the cooperation between each party.With the development of medical technology, a large amount of information about patients' vaccination records, medical histories, and medical payment records needs to be reserved. These records are not only stored in the local server but also permanently conserved in the blockchain by the smart contracts. When a patient visits different medical institutions, he/she can authorize medical staff to retrieve the history VR from the BC through the smart contract. Thus, the medical staff can provide better health services with the help of historical medical records.


## 3.1.1. BAN Logic

The Burrows-Abadi-Needham (BAN) logic proof model [29] is widely applied in security-related scholars for proving whether the mutual authentication has been achieved of a protocol or scheme.


## 3.1.2. ECDSA

To guarantee the security of the transmitted and exchanged message in the digital network, several encryption systems have been proposed by scholars. The elliptic curve digital signature algorithm (ECDSA), derived from the digital signature algorithm (DSA) [30], involves the concept of elliptic curve cryptography (ECC) [31]. While compared to DSA, the ECC reduces the key size in the algorithm and also provides a faster calculation speed.


## 3.1.3. Smart Contract

The smart contract [32] is a computer protocol designed to spread, verify, and execute a contract in a digital form. The promised agreement between each contract participant can be executed on it. The collaboration and trust between each contract participant can be achieved in blockchain through smart contracts, which can expand the cooperation between each party.With the development of medical technology, a large amount of information about patients' vaccination records, medical histories, and medical payment records needs to be reserved. These records are not only stored in the local server but also permanently conserved in the blockchain by the smart contracts. When a patient visits different medical institutions, he/she can authorize medical staff to retrieve the history VR from the BC through the smart contract. Thus, the medical staff can provide better health services with the help of historical medical records.


## 3.2. Security Requirements

The security requirements of our vaccination record storage and sharing system are listed as follows.(1)
Mutual authentication: in a proposed system, each party must confirm the legal identity of other parties in every phase. If any two parties can confirm one another’s legal identity, then mutual authentication is achieved.(2)
Data integrity: in an insecure network environment, the message delivered from the sender may be modified by a malicious attacker. Thus, the integrity of the transferred message must be maintained and should be ensured that it can defend against tampering during the transmission.(3)
Nonrepudiation: in each information exchange phase, the sender cannot refuse to acknowledge that the message he has been sent. A secure system must achieve nonrepudiation requirements.(4)
Resisting replay attacks: the communication between two parties may be intervened by malicious attackers. The malicious attackers will pretend to be a legitimate sender and send identical information to the intended receiver. This situation will lead to the leak of personal data security and, therefore, must be prevented.(5)
Resisting man-in-the-middle attacks: the attacker may intercept the message communicated between the sender and the receiver, and then, he/she can obtain the content of the message in the middle. This situation must be prevented too.


## 4. Proposed Scheme

In this section, we introduce the construction and workflow of our system in detail. The system framework is shown first. Then, the meaning of some notations is elaborated as follows.


### 4.1. System Framework

This study proposes a blockchain-based vaccination record storage and sharing system. Figure1 shows the main architecture of the proposed system, which is composed of four parties, including the blockchain center, the patient, the clinic, and the hospital. The detail of each party is described below.(1)
Blockchain center (BC) : The blockchain center is owned by the government. It manages all relevant data and operations on personal mobile devices and medical devices of the clinics and the hospitals. All mobile devices and medical devices need to be registered in the BC, and then, the three parties can mutually authenticate each other.(2)
Patient: Each patient carries a personal mobile device with them. The device stores a verification message that can uniquely identify the patient. Moreover, the primary message of the VR will be reserved in the personal mobile device and will be provided to the hospital in the future to diagnose.(3)
Clinic: The patient will be vaccinated at the clinic. The doctor of the clinic uses a medical device that can uniquely identify the clinic. When the patient goes to the clinic for vaccination, the doctor of the clinic can execute the vaccination for the patient and store the VR into the BC. Also, the patient will store the primary message of the VR on his/her mobile device.(4)
Hospital: The patient will be diagnosed in the hospital. The doctor of the hospital uses a medical device that can uniquely identify the hospital's identification. When the patient goes to the hospital seeking treatment for a symptom, the doctor of the hospital can retrieve the VRs through the primary message of the VR stored in the patient mobile device and further provide the diagnosis for the patient.Figure 1
The framework of the proposed system.The following is a description of our method. It should be noticed that all parties must register their corresponding devices in the BC and retrieve a unique ID and a private and public key pair from BC, respectively.Step 1: The patient goes to the clinic with his/her mobile device for vaccination, and the clinic and the patient must authenticate one another’s identity first. After mutual authentication, the doctor of the clinic will carry out the vaccination for the patient.Step 2: The doctor of the clinic will save the VR in the local server of the clinic and store VR into the BC through the smart contract technology.Step 3: The BC feedbacks the storage result to the clinic.Step 4: The doctor of the clinic returns the primary message of the VR to the patient, and the patient saves the message on his/her mobile device.Step 5: The patient visits the hospital with his/her mobile device for treatment of a symptom, and the hospital and the patient must also authenticate each other identity first. After mutual authentication, the patient provides the VR history in his mobile device to the doctor.Step 6: The doctor of the hospital retrieves the VRs from the BC according to the information acquired from the patient.Step 7: The BC feedbacks the details of VRs to the hospital.Step 8: The doctor of the hospital provides the diagnostic results for the patient based on the VRs.


### 4.2. Notations

The notations used in the study are listed in Table1.Table 1
The notations used in this study.
NameDescriptionIDXThe identity ofXpAk-bit prime numberFpFinite group ofpEE the elliptic curve defined on finite groupGG a generating point based on ERiThei-th random number based on E(rX, sX)The elliptic curve signature key pair forX(xX, yX)The ECDSA signature key pair forX(dX, QX)(dX, QX) the ECDSA private key and public key for XH()One-way hash function(SKX, PKX)The private key and public key forXCXThe ciphertext send byXTiThei-th timestampτThe threshold for checking the validity of timestampsMXThe sending message fromXEPKXMEncrypt messageM with the public key of XDSKXMDecrypt messageM with the private key of XX=?YVerify thatX is equal to Y or notVThe name of the vaccinationSThe symptom of the patientDThe diagnostic result of the patientVRThe vaccination recordKVRThe primary message of the VR


### 4.3. Initialization Phase

The fundamental chaincode structure of the proposed scheme is elaborated in this section. Figure2 shows the information structure of the access parties (APs) and the enumeration of the role type. Figure 3 shows the structure to store the vaccination record in the BC.Figure 2
The primary information is defined in the smart contract.Figure 3
The chaincode structure of the vaccination record is stored in BC.


### 4.4. Registration Phase

All parties need to register from the BC. The BC generates and sends the identity, public, and private key pair to the parties. The main process of the registration is presented as shown in Figure4.Figure 4
The framework of the registration phase.Step 1.
The access party (AP) provides the primary information (i.e., name and role) and sends a registration request to the BC.Step 2.
The BC generates an ECDSA private keydX and calculates public key QX by the following:(1)QX=dXG.
The information provided by the AP needs to be validated by the BC. If it is valid, the algorithm “Registration” will be executed, as shown in Algorithm 1. Then, BC sends (IDX, dX, QX) to AP.Step 3.
AP stores (IDX, dX, QX) for signing the signature message.
Algorithm 1: The smart contract Registration
Var APInfo [] APs.function Registration (string nameX, string detailX, Roles roleX){APInfo ap = new APInfo()Ap.ID = GenerateUniqueID()AP.name = nameXAP.detail = detialXAP.roleType = roleXAPs.append(ap)}


### 4.5. Authentication Phase

In this phase, we define the “Sign” and “Verify” functions that implement the ECDSA to achieve identity authentication between User A and User B. The definitions of these two functions are shown in Algorithm 2 and Algorithm 3. When User A and User B exchange messages, the sender generates a signature with a “Sign” function to the receiver. When the receiver receives the message, they execute a “Verify” function to verify. The flowchart of the authentication phase is shown in Figure5.Figure 5
The flowchart of the authentication phase.Algorithm 2: The smart contract Sign
function Sign (string h, stringR, Roles d) public returns (string r, string s){(x, y) = R ∗ Gr = x % ns = (h + r ∗ d)/x%nreturnr, s}Algorithm 3: The smart contract Verify
function Verify (string h, string r, string s) public return string result{u1 = h/s%nu2 = r/s%n(x, y) = u1 ∗  G + u2 ∗ Qifx ==r{return “valid”}else{return “invalid”}}Step 4.
User A selects a random numberR1 and calculates MA by equation (2). Then, User A calculates hA by equation (3).(2)MA=IDA||IDB||T1,(3)hA=HMA.
The signatures are generated by executing the function “Sign” in Algorithm 2. In detail, User A calculates the parameters of ECDSA by equation (4) and generates the signatures by equations (5) and (6). Then, User A encrypted MA with User B’s public key by equation (7) and sends IDA,IDB,CA,rA,sA to User B.(4)xA,yA=R1G,(5)rA=xAmodn,(6)sA=xA−1hA+rAdAmodn,(7)CA=EPKBMA.Step 5.
User B receives the message atT2 and decrypts CA with its private key by the following:(8)MA=DSKBCA.
Then, User B validates the timestamp by(9)T2−T1≤τ?.
If it is valid, User B executes the function “Verify” in Algorithm 3 to validate the signature of User A. In detail, User B calculates the parameters by equations (10)–(13) and validates the signatures by equation (14).(10)hA′=HMA,(11)u1=hA′sA−1modn,(12)u2=rAsA−1modn,(13)xA′,yA′=u1G+u2QA,(14)xA′=?rAmodn.
If it is valid, User B selects a random numberR2 and calculates MB by equation (15). Then, User B calculates hB by equation (16).(15)MB=IDA||IDA||T3,(16)hB=HMB.
The signatures are generated by executing the function “Sign” in Algorithm 2. In detail, User B calculates the parameters of ECDSA by equation (17) and generates the signatures by equations (18) and (19). Then, User B encrypted MB with User A’s public key by equation (20) and sends IDB,IDA,CB,rB,sB to User A.(17)xB,yB=R2G,(18)rB=xBmodn,(19)sB=xB−1hB+rBdBmodn,(20)CB=EPKAMB.Step 6.
User A receives the message atT4 and decrypts CB with its private key by the following:(21)MB=DSKACB.
Then, User A validates the timestamp by the following:(22)T4−T3≤τ?.
If it is valid, User A executes the function “Verify” in Algorithm 3 to validate the signature of User B. In detail, User A calculates the parameters by equations (23)–(26) and validates the signatures by equation (27).(23)hB′=HMB,(24)u1=hB′sB−1modn,(25)u2=rBsB−1modn,(26)xB′,yB′=u1G+u2QB,(27)xB′=?rBmodn.


### 4.6. Patient Vaccination Phase

The patient can visit any clinic that has registered in BC for vaccination. After the mutual authentication, the patient issues the clinic the name of the vaccination and gets the vaccination. The vaccine record will be saved in the mobile device of the patient and the local server of the clinic. Meanwhile, the signature of the patient and the clinic, and the hash value of the record accompanied by the identities of the patient, clinic, and vaccine will be stored in BC. The patient vaccination phase consists of five steps, as shown in Figure6. The detail of each step is described below.Figure 6
The flowchart of the patient vaccination phase.Step 7.
The patient selects a random numberR3 and calculates MP with the name of the vaccination, V, by equation (28). Then, the patient calculates hP by equation (29).(28)MP=IDP||IDC||V||T5,(29)hP=HMP.
The signaturesrP,sP are generated by executing the function “Sign” in Algorithm 2, as shown in the following:(30)rP,sP=SignhP,R3,dP.
Then, the patient encryptedMP with the public key of the clinic by equation (31) and sends IDP,IDC,CP,rP,sP to the clinic.(31)CP=EPKCMP.Step 8.
The clinic receives the message atT6 and decrypts CP with its private key by the following: (32)MP=DSKCCP.
Then, the clinic validates the timestamp by the following:(33)T6−T5≤τ?.
If it is valid, the clinic calculateshP′ and executes the function “Verify” in Algorithm 3 to validate the signature of the patient by equations (34) and (35).(34)hP′=HMP,(35)VerifyhP′,rP,sP.
If the signature is valid, the clinic executes the vaccination for the patient and generates the vaccination record,VR, including IDP, IDV (the identity of the vaccination V), IDC, the time of the vaccination, and other detailed information. At the same time, the primary message of VR, denoted as KVR, is generated and delivered to the patient.
Next, the clinic selects a random numberR4 and calculates MC with VR by equation (36). Then, the clinic calculates hC by equation (37).(36)MC=IDC||IDP||KVR||T7,(37)hC=HMC.
The signaturesrC,sC are generated by executing the function “Sign” in Algorithm 2, as shown in the following:(38)rC,sC=SignhC,R4,dC.
The algorithm “RIns” is triggered to create a record stored in BC, the algorithm of which is shown in Algorithm 4. The record includes the signature of the patient and the clinic.
Algorithm 4: The algorithm RIns
var Record[] recordsfunction RIns (string pID, string cID, string vID, string time, string p_Signature, string c_Signature) public {Record record = new Record()record.patientId = pIDrecord.clinicId = cIDrecord.vaccineId = vIDrecord.time = timerecord.p_Signature = p_Signaturerecord.c_Signature = c_Signaturerecords.append(reocrd)}
Finally, the clinic encryptedMC by the public key of the patient by equation (39) and sends IDC,IDP,CC,rC,sC to the patient.(39)CC=EPKHMC.Step 9.
The patient receives the message atT8 and decrypts CC with its private key by the following:(40)MC=DSKPCC.
Then, the patient validates the timestamp by the following:(41)T8−T7≤τ?.
If it is valid, the patient calculates and executes the function “Verify” in Algorithm 3 to validate the signature of the clinic by equations (42) and (43).(42)hC′=HMC,(43)VerifyhC′,rC,sC.
If the signature is valid, the patient stores theKVR on his/her mobile device.


### 4.7. Patient Treatment Phase

When the patient visits the hospital for treatment of a symptom related to vaccination history, mutual authentication should be first executed. After the authentication, the hospital will obtain the VR from BC byKVR, which is stored in a patient mobile device. After verifying the record with the hash value, the hospital performs a diagnosis and issues the diagnostic result about the patient. The patient treatment phase consists of five steps, as shown in Figure 7. The detail of each step is described below.Figure 7
The flowchart of the patient treatment phase.Step 10.
The patient selects a random numberR5 and calculates MP2 with the symptom, S, by equation (44). Then, the patient calculates hP2 by equation (45).(44)MP2=IDP||IDH||S||KVR||T9,(45)hP2=HMP2.
The signaturesrP2,sP2 are generated by executing the function “Sign” in Algorithm 2, as shown in the following:(46)rP2,sP2=SignhP2,R5,dP.
Then, the patient encryptedMP2 with the public key of the hospital by equation (47) and sends IDP,IDH,CP2,rP2,sP2 to the hospital.(47)CP2=EPKHMP2.Step 11.
The hospital receives the message atT10 and decrypts CP2 with its private key by the following:(48)MP2=DSKHCP2.
Then, the hospital validates the timestamp by the following:(49)T10−T9≤τ?.
If it is valid, the hospital calculates and executes the function “Verify” in Algorithm 3 to validate the signature of the patient by equations (50) and (51).(50)hP2′=HMP2,(51)VerifyhP2′,rP2,sP2.
If the signature is valid, the algorithm “RGet” is triggered to retrieve theVR. The definition of “RGet” is shown in Algorithm 5. Since the records contain the signatures of the patients and the clinics, it is convenient to track the validation of the record.
Algorithm 5: The algorithm RGet.
function RIns (string pID, string vID) public return Record record{. for (Record record in records){. if(record. patientId == pID && record. vaccineId = vID){return record}}return null}
Next, the hospital selects a random numberR6 and calculates MH with the diagnostic result of the patient, D, by equation (52). Then, the hospital calculates hH by equation (53).(52)MH=IDH||IDP||D||T11,(53)hH=HMH.
The signaturesrH,sH are generated by executing the function “Sign” in Algorithm 2, as shown in the following:(54)rH,sH=SignhH,R6,dH.
Finally, the hospital encryptedMH by the public key of the patient by equation (55) and sends IDH,IDP,CH,rH,sH to the patient.(55)CH=EPKPMH.Step 12.
The patient receives the message atT12 and decrypts CH with its private key by the following:(56)MH=DSKPCH.
Then, the patient validates the timestamp by the following:(57)T12−T11≤τ?.
If it is valid, the patient calculates and executes the function “Verify” in Algorithm 3 to validate the signature of the hospital by equations (58) and (59).(58)hH′=HMH,(59)VerifyhH′,rH,sH.
If the signature is valid, the patient stores theD in his/her mobile device.


## 4.1. System Framework

This study proposes a blockchain-based vaccination record storage and sharing system. Figure1 shows the main architecture of the proposed system, which is composed of four parties, including the blockchain center, the patient, the clinic, and the hospital. The detail of each party is described below.(1)
Blockchain center (BC) : The blockchain center is owned by the government. It manages all relevant data and operations on personal mobile devices and medical devices of the clinics and the hospitals. All mobile devices and medical devices need to be registered in the BC, and then, the three parties can mutually authenticate each other.(2)
Patient: Each patient carries a personal mobile device with them. The device stores a verification message that can uniquely identify the patient. Moreover, the primary message of the VR will be reserved in the personal mobile device and will be provided to the hospital in the future to diagnose.(3)
Clinic: The patient will be vaccinated at the clinic. The doctor of the clinic uses a medical device that can uniquely identify the clinic. When the patient goes to the clinic for vaccination, the doctor of the clinic can execute the vaccination for the patient and store the VR into the BC. Also, the patient will store the primary message of the VR on his/her mobile device.(4)
Hospital: The patient will be diagnosed in the hospital. The doctor of the hospital uses a medical device that can uniquely identify the hospital's identification. When the patient goes to the hospital seeking treatment for a symptom, the doctor of the hospital can retrieve the VRs through the primary message of the VR stored in the patient mobile device and further provide the diagnosis for the patient.Figure 1
The framework of the proposed system.The following is a description of our method. It should be noticed that all parties must register their corresponding devices in the BC and retrieve a unique ID and a private and public key pair from BC, respectively.Step 1: The patient goes to the clinic with his/her mobile device for vaccination, and the clinic and the patient must authenticate one another’s identity first. After mutual authentication, the doctor of the clinic will carry out the vaccination for the patient.Step 2: The doctor of the clinic will save the VR in the local server of the clinic and store VR into the BC through the smart contract technology.Step 3: The BC feedbacks the storage result to the clinic.Step 4: The doctor of the clinic returns the primary message of the VR to the patient, and the patient saves the message on his/her mobile device.Step 5: The patient visits the hospital with his/her mobile device for treatment of a symptom, and the hospital and the patient must also authenticate each other identity first. After mutual authentication, the patient provides the VR history in his mobile device to the doctor.Step 6: The doctor of the hospital retrieves the VRs from the BC according to the information acquired from the patient.Step 7: The BC feedbacks the details of VRs to the hospital.Step 8: The doctor of the hospital provides the diagnostic results for the patient based on the VRs.


## 4.2. Notations

The notations used in the study are listed in Table1.Table 1
The notations used in this study.
NameDescriptionIDXThe identity ofXpAk-bit prime numberFpFinite group ofpEE the elliptic curve defined on finite groupGG a generating point based on ERiThei-th random number based on E(rX, sX)The elliptic curve signature key pair forX(xX, yX)The ECDSA signature key pair forX(dX, QX)(dX, QX) the ECDSA private key and public key for XH()One-way hash function(SKX, PKX)The private key and public key forXCXThe ciphertext send byXTiThei-th timestampτThe threshold for checking the validity of timestampsMXThe sending message fromXEPKXMEncrypt messageM with the public key of XDSKXMDecrypt messageM with the private key of XX=?YVerify thatX is equal to Y or notVThe name of the vaccinationSThe symptom of the patientDThe diagnostic result of the patientVRThe vaccination recordKVRThe primary message of the VR


## 4.3. Initialization Phase

The fundamental chaincode structure of the proposed scheme is elaborated in this section. Figure2 shows the information structure of the access parties (APs) and the enumeration of the role type. Figure 3 shows the structure to store the vaccination record in the BC.Figure 2
The primary information is defined in the smart contract.Figure 3
The chaincode structure of the vaccination record is stored in BC.


## 4.4. Registration Phase

All parties need to register from the BC. The BC generates and sends the identity, public, and private key pair to the parties. The main process of the registration is presented as shown in Figure4.Figure 4
The framework of the registration phase.Step 1.
The access party (AP) provides the primary information (i.e., name and role) and sends a registration request to the BC.Step 2.
The BC generates an ECDSA private keydX and calculates public key QX by the following:(1)QX=dXG.
The information provided by the AP needs to be validated by the BC. If it is valid, the algorithm “Registration” will be executed, as shown in Algorithm 1. Then, BC sends (IDX, dX, QX) to AP.Step 3.
AP stores (IDX, dX, QX) for signing the signature message.
Algorithm 1: The smart contract Registration
Var APInfo [] APs.function Registration (string nameX, string detailX, Roles roleX){APInfo ap = new APInfo()Ap.ID = GenerateUniqueID()AP.name = nameXAP.detail = detialXAP.roleType = roleXAPs.append(ap)}


## 4.5. Authentication Phase

In this phase, we define the “Sign” and “Verify” functions that implement the ECDSA to achieve identity authentication between User A and User B. The definitions of these two functions are shown in Algorithm 2 and Algorithm 3. When User A and User B exchange messages, the sender generates a signature with a “Sign” function to the receiver. When the receiver receives the message, they execute a “Verify” function to verify. The flowchart of the authentication phase is shown in Figure5.Figure 5
The flowchart of the authentication phase.Algorithm 2: The smart contract Sign
function Sign (string h, stringR, Roles d) public returns (string r, string s){(x, y) = R ∗ Gr = x % ns = (h + r ∗ d)/x%nreturnr, s}Algorithm 3: The smart contract Verify
function Verify (string h, string r, string s) public return string result{u1 = h/s%nu2 = r/s%n(x, y) = u1 ∗  G + u2 ∗ Qifx ==r{return “valid”}else{return “invalid”}}Step 4.
User A selects a random numberR1 and calculates MA by equation (2). Then, User A calculates hA by equation (3).(2)MA=IDA||IDB||T1,(3)hA=HMA.
The signatures are generated by executing the function “Sign” in Algorithm 2. In detail, User A calculates the parameters of ECDSA by equation (4) and generates the signatures by equations (5) and (6). Then, User A encrypted MA with User B’s public key by equation (7) and sends IDA,IDB,CA,rA,sA to User B.(4)xA,yA=R1G,(5)rA=xAmodn,(6)sA=xA−1hA+rAdAmodn,(7)CA=EPKBMA.Step 5.
User B receives the message atT2 and decrypts CA with its private key by the following:(8)MA=DSKBCA.
Then, User B validates the timestamp by(9)T2−T1≤τ?.
If it is valid, User B executes the function “Verify” in Algorithm 3 to validate the signature of User A. In detail, User B calculates the parameters by equations (10)–(13) and validates the signatures by equation (14).(10)hA′=HMA,(11)u1=hA′sA−1modn,(12)u2=rAsA−1modn,(13)xA′,yA′=u1G+u2QA,(14)xA′=?rAmodn.
If it is valid, User B selects a random numberR2 and calculates MB by equation (15). Then, User B calculates hB by equation (16).(15)MB=IDA||IDA||T3,(16)hB=HMB.
The signatures are generated by executing the function “Sign” in Algorithm 2. In detail, User B calculates the parameters of ECDSA by equation (17) and generates the signatures by equations (18) and (19). Then, User B encrypted MB with User A’s public key by equation (20) and sends IDB,IDA,CB,rB,sB to User A.(17)xB,yB=R2G,(18)rB=xBmodn,(19)sB=xB−1hB+rBdBmodn,(20)CB=EPKAMB.Step 6.
User A receives the message atT4 and decrypts CB with its private key by the following:(21)MB=DSKACB.
Then, User A validates the timestamp by the following:(22)T4−T3≤τ?.
If it is valid, User A executes the function “Verify” in Algorithm 3 to validate the signature of User B. In detail, User A calculates the parameters by equations (23)–(26) and validates the signatures by equation (27).(23)hB′=HMB,(24)u1=hB′sB−1modn,(25)u2=rBsB−1modn,(26)xB′,yB′=u1G+u2QB,(27)xB′=?rBmodn.


## 4.6. Patient Vaccination Phase

The patient can visit any clinic that has registered in BC for vaccination. After the mutual authentication, the patient issues the clinic the name of the vaccination and gets the vaccination. The vaccine record will be saved in the mobile device of the patient and the local server of the clinic. Meanwhile, the signature of the patient and the clinic, and the hash value of the record accompanied by the identities of the patient, clinic, and vaccine will be stored in BC. The patient vaccination phase consists of five steps, as shown in Figure6. The detail of each step is described below.Figure 6
The flowchart of the patient vaccination phase.Step 7.
The patient selects a random numberR3 and calculates MP with the name of the vaccination, V, by equation (28). Then, the patient calculates hP by equation (29).(28)MP=IDP||IDC||V||T5,(29)hP=HMP.
The signaturesrP,sP are generated by executing the function “Sign” in Algorithm 2, as shown in the following:(30)rP,sP=SignhP,R3,dP.
Then, the patient encryptedMP with the public key of the clinic by equation (31) and sends IDP,IDC,CP,rP,sP to the clinic.(31)CP=EPKCMP.Step 8.
The clinic receives the message atT6 and decrypts CP with its private key by the following: (32)MP=DSKCCP.
Then, the clinic validates the timestamp by the following:(33)T6−T5≤τ?.
If it is valid, the clinic calculateshP′ and executes the function “Verify” in Algorithm 3 to validate the signature of the patient by equations (34) and (35).(34)hP′=HMP,(35)VerifyhP′,rP,sP.
If the signature is valid, the clinic executes the vaccination for the patient and generates the vaccination record,VR, including IDP, IDV (the identity of the vaccination V), IDC, the time of the vaccination, and other detailed information. At the same time, the primary message of VR, denoted as KVR, is generated and delivered to the patient.
Next, the clinic selects a random numberR4 and calculates MC with VR by equation (36). Then, the clinic calculates hC by equation (37).(36)MC=IDC||IDP||KVR||T7,(37)hC=HMC.
The signaturesrC,sC are generated by executing the function “Sign” in Algorithm 2, as shown in the following:(38)rC,sC=SignhC,R4,dC.
The algorithm “RIns” is triggered to create a record stored in BC, the algorithm of which is shown in Algorithm 4. The record includes the signature of the patient and the clinic.
Algorithm 4: The algorithm RIns
var Record[] recordsfunction RIns (string pID, string cID, string vID, string time, string p_Signature, string c_Signature) public {Record record = new Record()record.patientId = pIDrecord.clinicId = cIDrecord.vaccineId = vIDrecord.time = timerecord.p_Signature = p_Signaturerecord.c_Signature = c_Signaturerecords.append(reocrd)}
Finally, the clinic encryptedMC by the public key of the patient by equation (39) and sends IDC,IDP,CC,rC,sC to the patient.(39)CC=EPKHMC.Step 9.
The patient receives the message atT8 and decrypts CC with its private key by the following:(40)MC=DSKPCC.
Then, the patient validates the timestamp by the following:(41)T8−T7≤τ?.
If it is valid, the patient calculates and executes the function “Verify” in Algorithm 3 to validate the signature of the clinic by equations (42) and (43).(42)hC′=HMC,(43)VerifyhC′,rC,sC.
If the signature is valid, the patient stores theKVR on his/her mobile device.


## 4.7. Patient Treatment Phase

When the patient visits the hospital for treatment of a symptom related to vaccination history, mutual authentication should be first executed. After the authentication, the hospital will obtain the VR from BC byKVR, which is stored in a patient mobile device. After verifying the record with the hash value, the hospital performs a diagnosis and issues the diagnostic result about the patient. The patient treatment phase consists of five steps, as shown in Figure 7. The detail of each step is described below.Figure 7
The flowchart of the patient treatment phase.Step 10.
The patient selects a random numberR5 and calculates MP2 with the symptom, S, by equation (44). Then, the patient calculates hP2 by equation (45).(44)MP2=IDP||IDH||S||KVR||T9,(45)hP2=HMP2.
The signaturesrP2,sP2 are generated by executing the function “Sign” in Algorithm 2, as shown in the following:(46)rP2,sP2=SignhP2,R5,dP.
Then, the patient encryptedMP2 with the public key of the hospital by equation (47) and sends IDP,IDH,CP2,rP2,sP2 to the hospital.(47)CP2=EPKHMP2.Step 11.
The hospital receives the message atT10 and decrypts CP2 with its private key by the following:(48)MP2=DSKHCP2.
Then, the hospital validates the timestamp by the following:(49)T10−T9≤τ?.
If it is valid, the hospital calculates and executes the function “Verify” in Algorithm 3 to validate the signature of the patient by equations (50) and (51).(50)hP2′=HMP2,(51)VerifyhP2′,rP2,sP2.
If the signature is valid, the algorithm “RGet” is triggered to retrieve theVR. The definition of “RGet” is shown in Algorithm 5. Since the records contain the signatures of the patients and the clinics, it is convenient to track the validation of the record.
Algorithm 5: The algorithm RGet.
function RIns (string pID, string vID) public return Record record{. for (Record record in records){. if(record. patientId == pID && record. vaccineId = vID){return record}}return null}
Next, the hospital selects a random numberR6 and calculates MH with the diagnostic result of the patient, D, by equation (52). Then, the hospital calculates hH by equation (53).(52)MH=IDH||IDP||D||T11,(53)hH=HMH.
The signaturesrH,sH are generated by executing the function “Sign” in Algorithm 2, as shown in the following:(54)rH,sH=SignhH,R6,dH.
Finally, the hospital encryptedMH by the public key of the patient by equation (55) and sends IDH,IDP,CH,rH,sH to the patient.(55)CH=EPKPMH.Step 12.
The patient receives the message atT12 and decrypts CH with its private key by the following:(56)MH=DSKPCH.
Then, the patient validates the timestamp by the following:(57)T12−T11≤τ?.
If it is valid, the patient calculates and executes the function “Verify” in Algorithm 3 to validate the signature of the hospital by equations (58) and (59).(58)hH′=HMH,(59)VerifyhH′,rH,sH.
If the signature is valid, the patient stores theD in his/her mobile device.


## 5. Security Analysis

We will analyze the security of our system in terms of the following aspects.


### 5.1. Mutual Authentication

In this section, we use the BAN logic proof model to prove that mutual authentication in the authentication phase is guaranteed in our proposed system. The common notations used in the BAN logic are described in Table2.Table 2
Common notations are used in the BAN logic.
P|≡ XP believes XP⊲ XP sees XP|∼XP said XP|⇒ XP controls X#XX is freshP⟷KXP andX share the key K⟶KPK is the public key of PP⟺XQP andQ share the secret XTo achieve mutual authentication, the following goals should be satisfied, as shown in Table3.Table 3
The goals of the authentication analysis.
G1A|≡B⟷xBAG2A|≡B|≡B⟷xBAG3B|≡A⟷xABG4B|≡A|≡A⟷xABG5A|≡IDBG6A|≡B|≡IDBG7B|≡IDAG8B|≡A|≡IDAThe messages delivered between User A and User B are listed in Table4.Table 4
The delivered messages.
M1UserA⟶UserBIDA,IDB,T1PKB,rA,sAM2UserB⟶UserAIDB,IDA,T2PKA,rB,sBTo achieve the goals, the assumptions are made as shown in Table5.Table 5
The assumptions between User A and User B.
A1A|≡#T1A2B|≡#T1A3A|≡#T3A4B|≡#T3A5A|≡B|≡B⟷xBAA6B|≡A|≡A⟷rABA7A|≡B|⟹IDBA8B|≡A|⟹IDABased on the rules of BAN logic and these assumptions, the proof of the patient vaccination phase is as follows:(a)
User B authenticates User A.StatementS1 can be derived from M1 and the seeing rule.S1. B⊲IDA,IDB,T1PKB,rA,sAStatementS2 can be derived from A2 and the freshness rule.S2. B|≡#IDA,IDB,T1PKB,rA,sAStatement S3 can be derived from S1, A4, and the message meaning rule.S3.B|≡A|∼IDA,IDB,T1PKB,rA,sAStatement S4 can be derived from S2, S3, and the nonce verification rule.S4.B|≡A|≡IDA,IDB,T1PKB,rA,sAStatementS5 can be derived from S4 and the belief rule.S5 (G4) B|≡Α≡Α⟷xABStatementS6 can be derived from S5, A6, and the jurisdiction rule.S6 (G3) B|≡A⟷xABStatementS7 can be derived from S3 and the belief rule.S7 (G8) B|≡Α≡ΙDAStatementS8 can be derived from S7, A8, and the jurisdiction rule.S8 (G7) B|≡ΙDA(b)
User A authenticates User B.StatementS9 can be derived from M2 and the seeing rule.S9.A⊲IDB,IDA,T2PKA,rB,sBStatement S10 can be derived from A1 and the freshness rule.S10.A|≡#IDB,IDA,T2PKA,rB,sBStatement S11 can be derived from S9, A3, and the message meaning rule.S11.A|≡B|∼IDB,IDA,T2PKA,rB,sBStatement S12 can be derived from S10, S11, and the nonce verification rule.S12.A|≡B|≡IDB,IDA,T2PKA,rB,sBStatement S13 can be derived from S12 and the belief rule.S13 (G2)A|≡B|≡B⟷xBAStatement S14 can be derived from S13, A5, and the jurisdiction rule.S14 (G1)A|≡B⟷xBAStatement S15 can be derived from S12 and the belief rule.S15 (G6)A|≡B|≡IDBStatement S16 can be derived from S15, A7, and the jurisdiction rule.S16 (G5)A|≡IDBAccording to statements S6, S8, S14, and S16, these statements mutually authenticate the identities of User A and User B in the proposed scheme. Taking the patient vaccination phase into account, patient P and clinic C can authenticate each other through statements S17, S18, S19, and S20.S17 (G3)C|≡P⟷xPCS18 (G7)C|≡IDPS19 (G1)P|≡C⟷xCPS20 (G5)P|≡IDC


### 5.2. Nonrepudiation

To ensure the nonrepudiation in our proposed scheme, the message sent by the sender must be signed with the secret key of the sender. The receiver can verify the received message with the public key of the sender; therefore, the sender cannot deny sending the message. Table6 shows the verification equations that need to be verified by the receiver in every phase of the proposed scheme.Table 6
Nonrepudiation of the proposed scheme.
PhasesItemsSenderReceiverVerificationAuthentication phaseUser AUser BVerifyhA′,rA,sA​​​​​​​​​​User BUser AVerifyhB′,rB,sB​​​​​​​​​​Patient vaccinationPatientClinicVerifyhP′,rP,sP​​​​​​​​​​ClinicPatientVerifyhC′,rC,sC​​​​​​​​​​Patient treatmentPatientHospitalVerifyhP2',rP2,sP2​​​​​​​​​​HospitalPatientVerifyhH′,rH,sH​​​​​​​​​​


### 5.3. Data Integrity

To ensure the integrity of the message transmitted in each phase, this study applies the ECDSA to generate the signature value with the hash value. As shown in Algorithm 2, the signatures is generated by hash value h. Table 7 lists the signatures in each phase. All the signatures need to be verified by the receiver, as shown in Table 6.Table 7
Data integrity of the proposed scheme.
PhasesItemsSenderReceiverSignatureAuthentication phaseUser AUser BrA,sA=SignhA,R1,dAUser BUser ArB,sB=SignhB,R2,dBPatient vaccinationPatientClinicrP,sP=SignhP,R3,dPClinicPatientrC,sC=SignhC,R4,dCPatient treatmentPatientHospitalrP2,sP2=SignhP2,R5,dP2HospitalPatientrH,sH=SignhH,R6,dH


### 5.4. Resisting Replay Attack

The messages transmitted from the sender have added a sending timestamp and verified whether the timespan is valid in the receiver. The timestamp is added in each phase to resist the replay attack. For example, in the authentication phase, User A adds a timestampT1 in the message MA, which will be encrypted by the public key of User B, as shown in equations (60) and (61). User B decrypts the cipher message and checks the validation of the timespan, as shown in equations (62) and (63). When a malicious attacker sends the same message to the receiver to achieve the replay attack, the receiver will decrypt the cipher message and compare the sending timestamp with the current time. If the timespan is larger than the threshold, the attack will fail. Therefore, the replay attack cannot succeed in our proposed scheme.(60)MA=IDA||IDB||T1,(61)CA=EPKBMA,(62)MA=DSKBCA,(63)T2−T1≤τ?.


### 5.5. Resisting Man-in-the-Middle Attack

In our method, the message sent by the sender is encrypted by the public key of the receiver. The receiver can decrypt the cipher message with its private key. When a malicious attacker intercepts the cipher message, he/she cannot decrypt without the relevant private key. Therefore, our proposed system can resist the man-in-the-middle attack.


## 5.1. Mutual Authentication

In this section, we use the BAN logic proof model to prove that mutual authentication in the authentication phase is guaranteed in our proposed system. The common notations used in the BAN logic are described in Table2.Table 2
Common notations are used in the BAN logic.
P|≡ XP believes XP⊲ XP sees XP|∼XP said XP|⇒ XP controls X#XX is freshP⟷KXP andX share the key K⟶KPK is the public key of PP⟺XQP andQ share the secret XTo achieve mutual authentication, the following goals should be satisfied, as shown in Table3.Table 3
The goals of the authentication analysis.
G1A|≡B⟷xBAG2A|≡B|≡B⟷xBAG3B|≡A⟷xABG4B|≡A|≡A⟷xABG5A|≡IDBG6A|≡B|≡IDBG7B|≡IDAG8B|≡A|≡IDAThe messages delivered between User A and User B are listed in Table4.Table 4
The delivered messages.
M1UserA⟶UserBIDA,IDB,T1PKB,rA,sAM2UserB⟶UserAIDB,IDA,T2PKA,rB,sBTo achieve the goals, the assumptions are made as shown in Table5.Table 5
The assumptions between User A and User B.
A1A|≡#T1A2B|≡#T1A3A|≡#T3A4B|≡#T3A5A|≡B|≡B⟷xBAA6B|≡A|≡A⟷rABA7A|≡B|⟹IDBA8B|≡A|⟹IDABased on the rules of BAN logic and these assumptions, the proof of the patient vaccination phase is as follows:(a)
User B authenticates User A.StatementS1 can be derived from M1 and the seeing rule.S1. B⊲IDA,IDB,T1PKB,rA,sAStatementS2 can be derived from A2 and the freshness rule.S2. B|≡#IDA,IDB,T1PKB,rA,sAStatement S3 can be derived from S1, A4, and the message meaning rule.S3.B|≡A|∼IDA,IDB,T1PKB,rA,sAStatement S4 can be derived from S2, S3, and the nonce verification rule.S4.B|≡A|≡IDA,IDB,T1PKB,rA,sAStatementS5 can be derived from S4 and the belief rule.S5 (G4) B|≡Α≡Α⟷xABStatementS6 can be derived from S5, A6, and the jurisdiction rule.S6 (G3) B|≡A⟷xABStatementS7 can be derived from S3 and the belief rule.S7 (G8) B|≡Α≡ΙDAStatementS8 can be derived from S7, A8, and the jurisdiction rule.S8 (G7) B|≡ΙDA(b)
User A authenticates User B.StatementS9 can be derived from M2 and the seeing rule.S9.A⊲IDB,IDA,T2PKA,rB,sBStatement S10 can be derived from A1 and the freshness rule.S10.A|≡#IDB,IDA,T2PKA,rB,sBStatement S11 can be derived from S9, A3, and the message meaning rule.S11.A|≡B|∼IDB,IDA,T2PKA,rB,sBStatement S12 can be derived from S10, S11, and the nonce verification rule.S12.A|≡B|≡IDB,IDA,T2PKA,rB,sBStatement S13 can be derived from S12 and the belief rule.S13 (G2)A|≡B|≡B⟷xBAStatement S14 can be derived from S13, A5, and the jurisdiction rule.S14 (G1)A|≡B⟷xBAStatement S15 can be derived from S12 and the belief rule.S15 (G6)A|≡B|≡IDBStatement S16 can be derived from S15, A7, and the jurisdiction rule.S16 (G5)A|≡IDBAccording to statements S6, S8, S14, and S16, these statements mutually authenticate the identities of User A and User B in the proposed scheme. Taking the patient vaccination phase into account, patient P and clinic C can authenticate each other through statements S17, S18, S19, and S20.S17 (G3)C|≡P⟷xPCS18 (G7)C|≡IDPS19 (G1)P|≡C⟷xCPS20 (G5)P|≡IDC


## 5.2. Nonrepudiation

To ensure the nonrepudiation in our proposed scheme, the message sent by the sender must be signed with the secret key of the sender. The receiver can verify the received message with the public key of the sender; therefore, the sender cannot deny sending the message. Table6 shows the verification equations that need to be verified by the receiver in every phase of the proposed scheme.Table 6
Nonrepudiation of the proposed scheme.
PhasesItemsSenderReceiverVerificationAuthentication phaseUser AUser BVerifyhA′,rA,sA​​​​​​​​​​User BUser AVerifyhB′,rB,sB​​​​​​​​​​Patient vaccinationPatientClinicVerifyhP′,rP,sP​​​​​​​​​​ClinicPatientVerifyhC′,rC,sC​​​​​​​​​​Patient treatmentPatientHospitalVerifyhP2',rP2,sP2​​​​​​​​​​HospitalPatientVerifyhH′,rH,sH​​​​​​​​​​


## 5.3. Data Integrity

To ensure the integrity of the message transmitted in each phase, this study applies the ECDSA to generate the signature value with the hash value. As shown in Algorithm 2, the signatures is generated by hash value h. Table 7 lists the signatures in each phase. All the signatures need to be verified by the receiver, as shown in Table 6.Table 7
Data integrity of the proposed scheme.
PhasesItemsSenderReceiverSignatureAuthentication phaseUser AUser BrA,sA=SignhA,R1,dAUser BUser ArB,sB=SignhB,R2,dBPatient vaccinationPatientClinicrP,sP=SignhP,R3,dPClinicPatientrC,sC=SignhC,R4,dCPatient treatmentPatientHospitalrP2,sP2=SignhP2,R5,dP2HospitalPatientrH,sH=SignhH,R6,dH


## 5.4. Resisting Replay Attack

The messages transmitted from the sender have added a sending timestamp and verified whether the timespan is valid in the receiver. The timestamp is added in each phase to resist the replay attack. For example, in the authentication phase, User A adds a timestampT1 in the message MA, which will be encrypted by the public key of User B, as shown in equations (60) and (61). User B decrypts the cipher message and checks the validation of the timespan, as shown in equations (62) and (63). When a malicious attacker sends the same message to the receiver to achieve the replay attack, the receiver will decrypt the cipher message and compare the sending timestamp with the current time. If the timespan is larger than the threshold, the attack will fail. Therefore, the replay attack cannot succeed in our proposed scheme.(60)MA=IDA||IDB||T1,(61)CA=EPKBMA,(62)MA=DSKBCA,(63)T2−T1≤τ?.


## 5.5. Resisting Man-in-the-Middle Attack

In our method, the message sent by the sender is encrypted by the public key of the receiver. The receiver can decrypt the cipher message with its private key. When a malicious attacker intercepts the cipher message, he/she cannot decrypt without the relevant private key. Therefore, our proposed system can resist the man-in-the-middle attack.


## 6. Performance Analysis

We analyze the performance of our system in terms of the following aspects.


### 6.1. Computation Cost

The computation cost is also an important aspect to evaluate the performance of a system. Table8 elaborates the computation costs of our proposed scheme in each phase for BC, the hospital, the clinic, and the patient. It can be seen from Table 8 that each role has equal computation costs. For example, in the authentication phase, User A needs two symmetric encryption/decryption operations (TE), two hash function operations (TH), two additional operations (TA), one subtraction operation (TS), five multiplication operations (TM), and three division operations (TD).Table 8
The computation costs of the proposed scheme.
PhaseRole 1Role 2AuthenticationUser A:User B:2TE + 2TH + 2TA + TS + 4TM + 3TD2TE + 2TH + 2TA + TS + 4TM + 3TDPatient vaccinationPatient:Clinic:2TE + 2TH + 2TA + TS + 4TM + 3TD2TE + 2TH + 2TA + TS + 4TM + 3TDPatient treatmentPatient:Hospital:2TE + 2TH + 2TA + TS + 4TM + 3TD2TE + 2TH + 2TA + TS + 4TM + 3TD


### 6.2. Communication Cost

Assumed that an ID message required 128 bits, a cipher message required at least 512 bits, a signature message required 1024 bits, and other messages, like timestamp, requires 64 bits. As shown in the patient treatment phase, the patient encrypts the message, which contains 2 IDs, 1 timestamp, and a symptom described by the patient. The length of the symptom is set as 3 other messages, so the length of the cipher message is 2 × 128 bits +1 × 64 bits +3 × 64 bits = 512 bits.Taking the patient treatment phase into account, the patient and the hospital will exchange 2 messages, which require 2 IDs, 1 cipher message, and 1 signature operation message. Thus, it requires (1282 + 5121 +  10241) 2 = 1792 bits in total. The maximum transmission speed is 14 Mbps, 100 Mbps, and 20 Gbps in a 3.5 G, 4G, and 5 G environment. Thus, the transmission time is only 0.015 ms, 0.002 ms, and 0.01 us, which reveals that our system can be utilized in various real-time applications. Table9 lists the communication costs of the proposed scheme in each phase.Table 9
The communication costs of the proposed scheme.
PhaseMessage length (bits)3.5G (ms)4G (ms)5GAuthentication17920.0150.0020.01usPatient vaccination17920.0150.0020.01usPatient treatment17920.0150.0020.01us


### 6.3. Functionality Comparison

Table10 shows the functionality comparison of previous schemes and the proposed scheme. Our proposed scheme has the advantage of providing theoretical proof, solving the nonrepudiation issue, and providing the man-in-the-middle attack resistance.Table 10
The functionality comparison of previous schemes and the proposed scheme.
Scheme functionalityXu et al. [17]Liu et al. [22]Xu et al. [23]Our schemeInternet of things (IoTs)YesNoNoNoBlockchain architectureNoYesYesYesMutual authenticationNoYesYesYesData integrityYesYesYesYesResistance to replay attackNoYesYesYesResistance to man-in-the-middle attackNoNoNoYesNonrepudiationNoNoYesYesTheoretical proofNoNoNoYes


### 6.4. Limitations

There are some limitations in our system. First, every party must register in the blockchain center (BC) before joining the system. During the registration process, each participant needs to obtain the public key and private key pair of the elliptic curve signature from the BC. Second, the proposed scheme relies on stable power and network for normal operations. Thus, a backup power supply and a secure local network system can be established for the proposed system to prevent system failure.Overall, the proposed scheme in this study is focused on applying blockchain technology to solve the storage and sharing for VR. Some potential problems are not comprehensively considered, for example, the unpopularity or slow speed of the internet environment.


## 6.1. Computation Cost

The computation cost is also an important aspect to evaluate the performance of a system. Table8 elaborates the computation costs of our proposed scheme in each phase for BC, the hospital, the clinic, and the patient. It can be seen from Table 8 that each role has equal computation costs. For example, in the authentication phase, User A needs two symmetric encryption/decryption operations (TE), two hash function operations (TH), two additional operations (TA), one subtraction operation (TS), five multiplication operations (TM), and three division operations (TD).Table 8
The computation costs of the proposed scheme.
PhaseRole 1Role 2AuthenticationUser A:User B:2TE + 2TH + 2TA + TS + 4TM + 3TD2TE + 2TH + 2TA + TS + 4TM + 3TDPatient vaccinationPatient:Clinic:2TE + 2TH + 2TA + TS + 4TM + 3TD2TE + 2TH + 2TA + TS + 4TM + 3TDPatient treatmentPatient:Hospital:2TE + 2TH + 2TA + TS + 4TM + 3TD2TE + 2TH + 2TA + TS + 4TM + 3TD


## 6.2. Communication Cost

Assumed that an ID message required 128 bits, a cipher message required at least 512 bits, a signature message required 1024 bits, and other messages, like timestamp, requires 64 bits. As shown in the patient treatment phase, the patient encrypts the message, which contains 2 IDs, 1 timestamp, and a symptom described by the patient. The length of the symptom is set as 3 other messages, so the length of the cipher message is 2 × 128 bits +1 × 64 bits +3 × 64 bits = 512 bits.Taking the patient treatment phase into account, the patient and the hospital will exchange 2 messages, which require 2 IDs, 1 cipher message, and 1 signature operation message. Thus, it requires (1282 + 5121 +  10241) 2 = 1792 bits in total. The maximum transmission speed is 14 Mbps, 100 Mbps, and 20 Gbps in a 3.5 G, 4G, and 5 G environment. Thus, the transmission time is only 0.015 ms, 0.002 ms, and 0.01 us, which reveals that our system can be utilized in various real-time applications. Table9 lists the communication costs of the proposed scheme in each phase.Table 9
The communication costs of the proposed scheme.
PhaseMessage length (bits)3.5G (ms)4G (ms)5GAuthentication17920.0150.0020.01usPatient vaccination17920.0150.0020.01usPatient treatment17920.0150.0020.01us


## 6.3. Functionality Comparison

Table10 shows the functionality comparison of previous schemes and the proposed scheme. Our proposed scheme has the advantage of providing theoretical proof, solving the nonrepudiation issue, and providing the man-in-the-middle attack resistance.Table 10
The functionality comparison of previous schemes and the proposed scheme.
Scheme functionalityXu et al. [17]Liu et al. [22]Xu et al. [23]Our schemeInternet of things (IoTs)YesNoNoNoBlockchain architectureNoYesYesYesMutual authenticationNoYesYesYesData integrityYesYesYesYesResistance to replay attackNoYesYesYesResistance to man-in-the-middle attackNoNoNoYesNonrepudiationNoNoYesYesTheoretical proofNoNoNoYes


## 6.4. Limitations

There are some limitations in our system. First, every party must register in the blockchain center (BC) before joining the system. During the registration process, each participant needs to obtain the public key and private key pair of the elliptic curve signature from the BC. Second, the proposed scheme relies on stable power and network for normal operations. Thus, a backup power supply and a secure local network system can be established for the proposed system to prevent system failure.Overall, the proposed scheme in this study is focused on applying blockchain technology to solve the storage and sharing for VR. Some potential problems are not comprehensively considered, for example, the unpopularity or slow speed of the internet environment.


## 7. Conclusions

This study discusses the problems that occurred in the application of the vaccination record (VR) in reality and proposes a blockchain-based vaccination record storage and sharing system. The integrity of the VR and the privacy protection problems are solved by using blockchain technologies. The security of our system was analyzed such as mutual authentication, nonrepudiation, and data integrity. Moreover, our method can resist replay attacks and man-in-the-middle attacks. In particular, we use BAN logic to prove identity legality such that communication security is guaranteed between two parties. Not merely the computational and communication costs are quite low, the proposed method can save time and avoid medical risks than the current medical system.In the next work, we hope to improve the proposed system using artificial intelligence (AI) and deep learning techniques, which will be used to store VR in different formats and enable efficient VR search.



---

*Source: 2211065-2022-03-09.xml*