## 1 Introduction
### Blockchain in the Health Sector  
[PERSON] and [PERSON] [14] stated that data integrity and the privacy of medical records information are two of the primary issues facing the healthcare industry worldwide and are essential factors in considering blockchain as a feasible technology. [PERSON] and [PERSON] [15] determined that data exchange is the main reason blockchain should be used in healthcare because of the security and immutability this technology provides. Among the best-known applications of blockchain architectures implemented in the medical sector is the Estonian government's Guardtime System. Guardtime is the first blockchain-based healthcare system at the national level that creates a framework for validating patient identities by employing smart cards that link different government institutions with the healthcare sector. This method creates links or bridges between entities, thus ensuring the flow of information, but its scope needs to reach the operational bases of the system [16]. Another well-known application is MedRec, a project developed by MIT Media Lab and Beth Israel Deaconess Medical Center. This public blockchain network type uses pointers and creates bridges between hospital service providers, patients, and hospitals. Its weakness is security, as it assumes that its administrators ensure the integrity of the databases of participating entities [17]. [PERSON] et al. [18] developed the Mayo application, which strengthens semantic and syntactic interoperability by pushing nodes to produce proof to reach network consensus that the data referenced by a transaction can be meaningfully interpreted. It develops a consensus called interoperability. This application is designed for clinical service providers and presents difficulties in identifying patients in institutional nodes.  
The present work proposes a secure, private, and immutable medical record architecture using blockchain-based smart contracts that provide a secure execution and storage environment for smart contracts. The proposed algorithm has distribution, storage, consensus, and encryption technology. It connects patients and healthcare personnel to medical records, allowing them to consult with a high degree of privacy. The primary contributions of the algorithm are as follows:  
1. We provide a dynamic, distributed access control system for effective, reliable, and authoritative data sharing for users in a healthcare system. The registration contract covers the entire medical system scenario by using smart contracts for user authentication. It comprises three entities: patients, hospitals, and some current regulatory frameworks.  
2. The consensus protocols allow transactions to be made by utilizing blockchain without an outside party. To avoid congestion and reduce overhead in the blockchain network, we modify the original consensus protocol of the blockchain, namely, proof of work (PoW). We choose to formalize an alternative to using a lightweight PoW algorithm. This algorithm consumes low energy when used in the medical history. The design goal is summarized as compact, fast, and optimized for lightweight applications.  
The remaining sections of this document are structured as follows. In Section 2, we present related works. Next, in Section 3, we discuss the materials and methods used in the study, the recommended structure, and the implementation. In Section 4 we talk about the performance and outcomes, respectively. The paper is concluded in Section 5.