Decentralised Blockchain-based Solutions for Electronic Healthcare Record with Interacting Social Networking Components

—The healthcare industry is a conjunction of mono-lithic applications based on neutral and time-stamped diagnostics. Hence, it is particularly interested in decentralised technologies to achieve global and social-driven electronic health records. Blockchain is a decentralised networking system where multiple copies of immutable data records are distributed and validated among different independent nodes. While traditionally used to create currently famous digital cryptocurrencies like Bitcoin, its worldwide fever helped to extend its applications beyond the ﬁnancial industry. However, given how fast completely new technologies evolve, healthcare stakeholders are struggling to ﬁnd the correct usage of blockchain ecosystem developments. Our goal is to provide a summary of the state-of-the-art efforts in the development of decentralised blockchain-based solutions for electronic healthcare records, in which social networking and wearable technology data is considered in order to provide patient-driven diagnostics – proven to be critical in the current SARS-CoV-2 pandemic. In this paper, we present a comprehensive guide on blockchain technologies competing in the healthcare market, including emerging blockchain-based initiatives and trends. Additionally, we discuss the main caveats of blockchain applications development in this industry based on practical experience.


I. INTRODUCTION
We are converging towards a globalised world with interconnected healthcare industries and services.The patients, the most prominent stakeholders of the healthcare network, are pushing the ecosystem towards a patient-mediated and patientcentred data exchange paradigm [1].The crucial component is the Electronic Health Record (EHR), which stores the patient's health information in a digital format [2].Unfortunately, the healthcare industry lacks reliable channels for end-toend communication, including environment data from social networking, wearable technologies, and new patterns from automatic data analyses (e.g., tweets) [3].Additionally, these channels must guarantee compliance with current legislation and protect individuals' privacy such as personal and medical information [4].
This interoperability shift produces complex technological challenges and requirements in scalability, security and anonymity.Moreover, the adoption of cloud data storage and locally interconnected smart health devices comes with increasing risks of malicious attacks.The trends in sensors and wearable health devices for social and real-time monitoring exacerbate those risks [5].For an international-grade EHR management system to succeed, local, national, and international governments must agree to collaborate, share, and invest in a technology-centred approach to healthcare.
Other major stakeholders in healthcare (e.g., physicians, researchers, pharmaceutical, insurance firms) also clash with: • Locally registered, distributed and siloed data.
• Slow intermediate communications and analyses.Updating, growing, and maintaining these systems proves to be very difficult, as a change in just a single artefact relays multiple changes for related parties in the system.To make things more complicated, healthcare providers hesitate to exchange data in response to ambiguous regulations as GDPR, which defines liability and financial consequences related to personal data sharing [6].Stakeholders may confront several hurdles in establishing data retrieval and sharing caused by the current data market incentives encouraging a "health information blocking" -exactly what we tackle in this work.
In summary, healthcare exchange and data analysis demands are growing exponentially due to the increase in mobility, growing populations, prolonged life expectancy, higher prevalence of chronic diseases, and a wider variety of healthcare services.The same factors produce a continued rise in demand and expenses for healthcare -the global healthcare industry spending is growing at an annual rate of 5.4% between 2018 and 2022 [7].Our contributions in this work are: 1) A comprehensive guide on blockchain technologies competing in the EHRs market, including research directions and gaps, initiatives, trends and applications.2) An practical analysis of the main caveats in the development of blockchain applications in the health industry.This document is structured as follows.Section 2 presents the background of applied blockchain.Section 3 discusses the

II. BACKGROUND ON BLOCKCHAIN TECHNOLOGY
Blockchain originally came from the cryptography research community of the software engineering field [8].The term is publicly known for the speculative market of cryptocurrencies where the big players are Bitcoin and Ethereum; their technical word is tokens, and they are awarded to the participants in the network that, besides operating, are helping to maintain it.There are 31 healthcare tokens used in different blockchains (see sectionIV).For example, the Solve.Care Foundation brings us Solve [9], the healthcare token with the highest value to date and available in most of the leading exchanges.Solve blockchain has the mission to decentralise and redefine the administration of healthcare and other benefit programs.
Networks like Solve, referred to as ledgers, overcome centralisation with an infrastructure composed of a distributed peer-to-peer network of supporting nodes.Blockchain was coined as such to reflect how the data is stored in the ledger; the data structure is an ordered list of blocks, where the blocks are the containers aggregating transactions.For more details, we refer the readers to [10].A trivial example is our bank's passbooks, filled with monetary transactions between participants (i.e., bank clients).As each passbook is updated, every new block/transaction is identifiable, immutable, and linked back to its previous block in the ledger.
Most tokens, including the ones in healthcare, are present on the online financial cryptomarkets -the online "Wall Street" for cryptocurrencies trading [11].They all belong to the first generation of blockchains, defined as public ledgers to store cryptographically signed financial transactions.The second generation comprises a general-purpose programmable infrastructure in a public ledger [12], where physical assets can be introduced within the network (e.g., pharmaceutical drugs).Above it, we can find two different approaches aiming to improve the scalability of these generations: • Second and tertiary business logic layers, which are blockchains over a master blockchain (e.g., Polygon MATIC is a layer two on Ethereum [13]).• The blockchain third generation, which is still under development (e.g., Ethereum 2.0, Cardano, Polkadot).The software programs that run in these blockchains are known as smart contracts [14] -it is the coined term; they are not necessarily smart nor related to any legislation.This is identifiable in the business logic layer of the architecture block diagram of Figure 1, shared with the transactions.
Blockchain users identifications, referred to as wallet addresses in the first generation, are public keys (i.e., cryptographical digital signatures), that ensure authorisation of blockchain transactions [15].The process is summarised as: 1) A product request: Buying Ibuprofen in a pharmacy.
2) A signed network transaction with the user public key.
3) If the nodes deem that it is a valid transaction (e.g., the buyer is an adult, and the pharmacy has stock), they propagate it throughout the network iteratively until each node register this transaction (i.e., reach a consensus) In the case of a node failure, Byzantine Fault Tolerance keeps the network running if there are enough replications in the distributed computing layer (see Figure 1), which also hosts the different types of consensus [16]: • Proof of Work (PoW): Supporting nodes race to solve very complex cryptographic problems, obtaining as reward tokens if they succeed (e.g., Bitcoins).• Proof of Stake (PoS): In the second generation, mining was replaced with pure token ownership.The chance that a node will actively verify a transaction and obtain the awarded tokens is directly proportional to the number of tokens already own.Delegated PoS, Bonded PoS, and Liquid PoS are improved versions, where there is preselection of competing nodes.Tokens are awarded to attract nodes to the system.Unlike DPoS, BPoS, and LPoS that are bulletproof, nodes could violate the consensus with a massive rack of powerful machines (PoW) or enough owned tokens (PoS) [17].However, there exist blockchains without tokens, where the nodes are nonprofit (e.g., a government blockchain, a hospital's blockchain).
A blockchain transaction within the network can be requested by anyone with a freely provided public key (e.g., Bitcoin public ledger), by anyone with a unilaterally provided key (e.g., Ethereum private ledger), or by a public key with specific permits (e.g., Hyperledger permissioned ledger) [18].These categories are not related to data accessibility infrastructure (Figure 1), which, besides specific permits, could be cryptographically encrypted within the ledger (i.e., on-chain), or externally hosted (i.e., off-chain) having on-chain linkscryptographically encrypted hashes (e.g., to Hospitals EHRs databases) [19].In the case of smart contracts directly requesting off-chain data, Oracles communication protocols must be used, as they interconnect different systems and ledgers, hence supporting the transmission, access, and validation of data from external sources to a master blockchain system.Concretely, oracles synchronise initially offline off-chain data, often generated in poor connectivity areas and devices [20].

III. ARCHITECTURES OF HEALTHCARE BLOCKCHAINS
This section reviews practical blockchain development experiences for EHRs.Besides including our work [21], we have performed a systematic search in Google Scholar similarly to [2] and [22] with the following keywords alongside blockchain: health, healthcare, medical, EHR, patients, medics, insurance, medical, doctors, physicians and pharma, reaching the 37 references of this paper.We pretend to attract and support new developments aiming to solve the "health information blocking" using any blockchain framework: • Blockchain: A healthcare blockchain is an emergent approach to avoid expensive and inefficient intermediaries and reinforce trust for stakeholders, participants and systems.
• Ledger: Each stakeholder/participant has a different set of actions (e.g., just a physician can update a patient's EHR).A permissioned ledger provides enough flexibility to adapt the system to any scenario [23].[24].Raft decomposes a transaction request into relatively independent sub-tasks, improving security -a single node cannot validate a whole transaction.Unlike Hyperledger, these alternatives have an advantage: the abstraction from supporting and managing, whether economically or not, the consensus of the ledger.This softens the initial learning curve and requirements of any blockchain project.• Documentation: Most alternatives lack documentation and expert developers.Ethereum and its forks shine with several books, online courses, and applications in production.Its number of decentralised applications overwhelm any other competitor; in other words, whether the most capable or not, it is the most used, and hence, tested.• Networks: Instead of dealing with your own infrastructure, the trend is to deploy them in running networks (e.g., Infura Ethereum mainnet [25]) focusing on the blockchain application layer.In the cases of Hyperledger and Quorum, there are expert solutions like the Alastria consortium, a Spanish-based European non-profit ledger [26].Similar consortiums exist in other continents, as the South-American simile LacChain [27] (soon to be merged with Alastria).While non-mandatory, we can join new nodes to the consortium, which can be postponed to the later stages of a new decentralised application.• Blockchain as a Service (BaaS): There is an increasing number of providers of blockchain infrastructures with a history in the Quality of Service (QoS) in cloud computing and services (e.g., Amazon AWS, Oracle, IBM, Microsoft) [22].These alternatives reduce the overall costs and QoS compared to in-the-house solutions.• Programming Languages: Smart contracts (e.g., Solidity [28]) are more robust against programming bugs than general-purpose languages (e.g., JavaScript) [29].• Data: Only encrypted hashes must be on-chain [30].For example, the hashes link the pieces of a patient's EHR as the diagnostics, images, and insurance to hospitals' and insurers' local systems.If any data is modified outside of the ledger (i.e., locally), the external hashes are updated.
Those hashes are incongruent with the on-chain ones; consequently, that data is discarded forever.The right to be forgotten, a mandate in many countries, is incompatible with on-chain data (immutability).Off-chain data from poorly connected devices requires oracles.• Identities: A blockchain is anonymous by definition.So, by no means personal data must be on-chain.However, users should be able to painlessly identify themselves in a permissioned network, where a lengthy alphanumeric string is not user-friendly.Identification systems as biometrics must be encoded off-chain while being linked with the on-chain identifier.For example, Alastria ID is a front-end application of official and standard identifiers (e.g., passport, IBAN, fingerprint, social security number) for Alastria hosted blockchain applications.• Transactions: Following a Rest API, transactions are requested through clean URLs with a subfolder pattern (e.g., BCP Quorum Rest).Nevertheless, there are other platform API mentioned in Figure 1 like the next one.• User interface: Angular applications are single-page web apps; as all the logic is in the front-end, there is no need for a back-end server.This suits blockchain networks perfectly, as developers only need to maintain a web app and the ledger smart-contract.As for the end-users, only a web browser is needed.

IV. RELATED WORK IN HEALTHCARE SYSTEMS
Literature is heading into a context-based blockchain healthcare ecosystem, focused on user profiles.Additionally, blockchain scalability and efficiency issues are considered in a more low-level approach.On the other hand, data and privacy regulation is a cross-domain area, stretching to ethics and politics of technology.  is yet under consideration.Hence, we have identified the following gaps: • Sensors and wearables are not covered in any solution [7].
• Normally, graphical interfaces and user experience are alike, not considering the profile of each stakeholder (e.g., patient age, doctor department, local legislation) [4].• Adoption without (economic) incentives is unlikely [18].
• Real-time data and analyses are probably impossible [22].The worldwide blockchain fever: innovators and decisionmakers suffer from the "hammer looking for a nail" syndrome.Blockchain is, by definition, a powerful tool: anonymity, encryption level security, fraud control, completely trackable data, full P2P decentralisation, to name just a few advantages [31].Though, is blockchain the right technology for any problem?Probably not -unless trackable trust between users is part of our system's core.Blockchain is the right tool if; our stakeholders need to trust each other, we need to keep persistent and immutable records of our decentralised data, and no one should be able to tamper with that data [32].
As a patient, anyone can tell the healthcare ecosystem is flawed.With blockchain, we can solve many of the problems that our current ecosystem faces [7], which we grouped in: 1) Service latency and inefficiency: due to multiple inconsistent data silos, fragmented healthcare records and complex data access -this problem multiplies with the mobility and migration rates of the population; high costs (time and labour) to collect, transfer, process, validate and aggregate information from the stakeholders for everyday tasks such as verifying medical credentials, healthcare records of a patient, insurance coverage, and credit application for medical care [33].2) Data privacy and security: patients' ownership of data, data breaches of purely centralised data centres, and unconsented disclosure of identifiable EHRs from hospitals and insurance agencies are common flaws [34].3) Trust: medical credentials, (fraudulent) health insurance -Healthcare data breaches.
-Data inconsistencies due to multiple information silos (regulators, tax authorities, policyholders, physicians, credit agencies, insurance companies, and medical institutions).
Expected results and impact -Agile insurance management using smart contracts -when all conditions are met, the insurance policy should be automatically paid out.
-Transparent, immutable, and traceable and policy agreements between insurance policyholders and insurers.

Pharma Industry Medical Centers Patients Regulators
Drug Supply Chain Security and Tracking [public blockchain] Problems Tackled -Fake and low-quality drugs sell as genuine products.
-Purchasers do not have access to the necessary information to make informed purchase decisions.
Expected results and impact -As a consumer, have the means to be informed correctly about the product you are buying.
-Be able to choose between safe and low-quality drugs.
claims or fake and untested drugs and products [35].
The main actors in the healthcare ecosystem include physicians, medical centres, the pharmaceutical industry, insurance agencies, credit agencies, regulators, and tax authorities [36].They have a joint stakeholder, the patient, and their business is to provide healthcare-related services.Given the complexity of the system, it is unrealistic to imagine that any time soon shall emerge a unified system taking care of all the involved parties' needs despite their often contradictory interests.In practice, we have observed a bottom-up movement, tackling particular problems with ad hoc solutions, organically transforming the healthcare ecosystem.Figure 2 outlines ongoing initiatives to solve the mentioned problems and others; generally, they are globally-oriented solutions.In Table I, we exemplify how trust, service inefficiency, and lack of canonical communication channels between stakeholders can be mitigated using interconnected blockchain-based implementations for Medical Credentialing, EHRs, Healthcare Insurance Management, Drug Supply Chain Security and Tracking.
It is natural to start small, with geographically delimited services, especially for EHRs and insurance applications.Despite the limited geographical coverage for short-term use, these building-block-sized solutions ought to be designed having in mind scalability, inter-connectivity, and interoperability [37].As the European Commission Recommendation on an EHR exchange format of 2021 indicates1 , the future lies in networked solutions, capable of sharing information across different healthcare networks.However, this last statement is not trivial.Even though there are ongoing projects on interoperability, where the state-of-the-art are Cardano (ADA), Chainlink (LINK), Cosmos (ATOM), Algorand (ALGO), Polkadot (DOT) and Kusama (KSM), nowadays, if we want independent blockchain-based applications to share information at production level, we are somewhat stuck to using development platforms from the same blockchain-family.

V. CONCLUSIONS
Blockchain is a powerful and promising tool for the global healthcare ecosystem by improving its transparency, interoperability, auditability, and security.This paper presents the main architectural caveats: adaptability, manageability, and expertise -a state-of-the-art ledger may become unexpectedly adopted or deprecated.We also discuss the current tokens and alternative applications of blockchain in healthcare.After reviewing the state-of-the-art development in EHRs blockchain, we note that current frameworks provide increasing levels of support for healthcare services.We foresee wide adoption of blockchain technology in governmental and public services in the near future, as this disruptive and fragmented technology becomes standardized and regulated.

Fig. 2 .
Fig. 2. A global view blockchain and healthcare.In the lower part of the image, each marker represents a blockchain initiative in the healthcare industry.To see more details about each initiative, visit http://clinicappchain.com/mapand click on the markers.
Finally, cross-technology integration Check clinicappchain.com/mapfor details on individual projects and initiatives.
Blockchain-based initiatives to improve the healthcare industry have emerged mostly in the US and Europe, as you may see below.

TABLE I A
BRIEF DEFINITION OF FOUR MAJOR APPLICATIONS OF BLOCKCHAIN IN HEALTHCARE.Tedious and costly credentials verification and justification for employing health centers, practitioners, and patients Expected results and impact -Public medical credentials, certified and validated by the corresponding authorities (Medical school, employer, etc.) -Close to zero time and manual labor needed for medical staff credentialing.Difficult to access and aggregate a patient's medical records when they are distributed among different medical institutions.-Difficultforresearchers to learn from patient's medical histories using modern data analysis and big data techniques.-Duplicatelabor: clinics and hospitals have their own databases to keep patient records.Medical centers often repeat tests because they do not have access to the medical history of the patient, and the data transfer between centers in not supported.