Skip to main content
AMIA Annual Symposium Proceedings logoLink to AMIA Annual Symposium Proceedings
. 2020 Mar 4;2019:1266–1275.

Comparison of Smart Contract Blockchains for Healthcare Applications

Hongru Yu 1,*, Haiyang Sun 2,*, Danyi Wu 1,*, Tsung-Ting Kuo 1
PMCID: PMC7153130  PMID: 32308924

Abstract

Blockchain and smart contracts (i.e., computer code that can be run on blockchain) are increasingly popular for healthcare applications. However, only very few implementations exist because of the complexity of the technologies. Although there are tutorials and reviews to introduce blockchain and smart contracts, a pragmatic comparison of such platforms is needed. In this study, we addressed practical considerations while building a healthcare blockchain and smart contract system, by (1) comparing technical features of platforms, (2) selecting three platforms, (3) constructing blockchain networks, (4) testing the blockchains, and (5) summarizing the experience and time used for implementation by students. We evaluated Ethereum, Hyperledger Fabric, and MultiChain, and confirmed that the selection of a proper platform depends on the requirements of the application. The findings of our study can accelerate the process and reduce the risk of adopting blockchain technology in biomedical and healthcare domain.

Keywords: Data Sharing, Interoperability and Health Information Exchange, Privacy and Security


Learning Objective: Understand smart contract blockchain platforms and their comparison for healthcare.

Introduction

Since Bitcoin,1,2 blockchain technology has evolved and is now considered as a new form of a distributed ledger, since arbitrary data can be stored in the metadata of the transactions.3 With this capability, many blockchain-based healthcare applications are emerging rapidly. Example applications include unalterable patient records,4 improved care data sharing/analysis without ceding control,5-7 and enhanced robustness for counterfeit drug prevention/detection systems in pharmaceutical supply chains.8

Among the new developments of the blockchain technology, smart contract is one of the most important advancements.9-19 Smart contracts refer to computer programs/code devised to manage smart properties, which are the digital properties recorded by blockchain.11 That is, a smart contract is a piece of computer code that can be run within a blockchain transaction. For example, a smart contract has been proposed to automate the workflow of medical licensure across multiple states.20,21 It removes the requirement for human confirmation of precursors and results, and instead relies on machines to automatically execute the logic stated in the program to accept or reject a request. Smart contracts are also transparent and immutable. An example is shown in Figure 1, demonstrating the potential to manage the data queries requested by an institution to another within a clinical data research network. Therefore, we consider smart contract as a very useful and desired feature for healthcare applications.

Figure 1.

Figure 1.

Example of smart contract for data queries such as “how many patients have hemoglobin test results for postmenopausal females”. (a) Traditional process of a researcher requesting a data query within a clinical data research network (i.e., from University A to University B), including the use of an electronic form as well as the need for a data concierge person to manage and respond to the queries. (b) Blockchain-based smart contract approach to manage/record the data queries automatically without human. Note that the choice of the query depends on the Institutional Review Board (IRB) approval as well as the Data Usage Agreement (DUA) signed between universities.

Many researchers have proposed to adopt blockchain and smart contracts in healthcare, genomic, or biomedical applications,4-6, 8, 22-35 but only very few have actually implemented these technologies due to their complexity.3 Therefore, understanding practical considerations while exploring smart contract technology is imperative, and can facilitate the adoption of the new technology for a wild spectrum of healthcare applications. Although there are broad tutorials and reviews about blockchain and smart contracts,36-39 a pragmatic comparison and evaluation of the smart contract platforms is needed.

Methods

In this study, we addressed the practical considerations while building a healthcare blockchain and smart contract system. Specifically, we compared the technical features of the smart contract blockchain platforms, selected platforms for our study, constructed a blockchain network for each of the platform, tested the blockchains, and summarized our experience and time used for the implementation by students. First, we selected technical features of the smart contract blockchain platforms based on our recent review/report,3,38 as shown in Table 1. Based on the technical features described in Table 1, we identified three platforms to be compared in this study, out of ten popular platforms:3,38

Table 1.

Technical features to compare smart contract blockchain platforms.

Technical Feature Description
Type of Smart Contract The typ of smart contract supported in the platform, can be either first generation (i.e., supports scripting functions without full programming capacity such as looping) or second generation (i.e., supports any algorithm).
Programming Language The language for smart contract (e.g., Solidity40-42 for Ethereum11, 43).
Network Permission The supported permission type of blockchain network, can be permissionless (i.e., any machine can join the network freely, as for Bitcoin Blockchain), permissioned (i.e., only an authenticated machine can join the network), or both.
Open Source License The license to distribute derivative products (e.g., MIT44 or GPL45)
Applications Proposed applications in healthcare.
  • Ethereum11,43 is one of the most well-known decentralized smart contract blockchain platforms.11, 17, 43, 46 Ethereum is also a cryptocurrency itself, and has a large market cap.47 Microsoft adopted Ethereum as the core of its Blockchain-as-a-Service (BaaS) on the Azure cloud computing environment,48 however Ethereum can be run in any cloud computing environment. Ethereum has been used in healthcare applications and, most importantly, supports second-generation smart contracts.3 Ethereum can work with both external owned accounts and internal contract accounts.49 It also uses the concept of ‘gas’ to regulate computationally intensive smart contract code.46 Ethereum has a build-in currency (Ether), and Wei is the smallest fraction of Ether.50 The main reasons to select Ethereum were the capability to be configured as both a permission-less and a permissioned blockchain network, as well as the community-based development of the platform.

  • Hyperledger Fabric51-53 is an enterprise-grade cross-industry platform supported by IBM.53,54 Hyperledger, a project under the Linux Foundation,51,52 is a platform with various “dialects”, and we selected Hyperledger Fabric because it is one of the popular smart contract platform that requires no specific hardware to be executed.3,38 Hyperledger also has a Composer component that supports a purpose-built modeling language for defining a business network, multiple ways of integrating blockchains with other services, and a platform for developing, testing and deploying custom business logic.55 The Hyperledger Composer, along with its Playground feature, enables developers to use pre-existing sample network frameworks to plan their network construction through a user-friendly, easily accessible web interface. There are also Software Development Kits (SDKs) available on Hyperledger Fabric’s website for potential C and Java developers. The main considerations to choose Hyperledger Fabric were the capability to be configured as a permissioned blockchain network and the access control feature with high granularity.

  • MultiChain56, 57 is a platform that currently only supports first-generation smart contracts as well as limited programs, or “smart filters”.58 It also does not yet support complex syntaxes based on Turing-complete programming languages that can execute any algorithm. Currently, a MultiChain smart filter is restricted to programming instructions that do not allow for operations such as loops and recursion. However, MultiChain provides many built-in functions to support basic building blocks for applications,58 and can be used directly for operations like sending or receiving transactions. MultiChain also supports data streams (i.e., key-value pairs) based on transaction metadata.59 Many MultiChain APIs have been developed for mainstream programming languages such as Java and JavaScript, enabling developers to run complex programs on MultiChain. The main reasons to include MultiChain were the simple setup process and the features inherited from Bitcoin Blockchain.1,2

Our comparative analysis was conducted by three undergraduate/graduate students with no prior experience in blockchain technologies to construct, test, and summarize the experiences related to the three selected platforms in parallel. While only one student developed code for each one of the platforms, they compared notes and discussed solutions as a group, with facilitation from a faculty member (T-TK). First, we constructed three selected smart contract blockchain networks. We used six virtual machines (VMs), each has 2-Core CPU, 8GB RAMs and 100GB storage, with 64-bit Ubuntu 14.04 operating system, on the Google Cloud Platform.60 We then tested the blockchain platforms by submitting transactions or deploying/executing smart contracts on them. Finally, we summarized our implementation experiences for these blockchain platforms, with an estimation of the required time for setup and learning time for an undergraduate or a graduate student.

Results

We compared the platforms by extracting the technical features,3,38 and the results are shown in Table 2. Our experience and setup/learning time of constructing three blockchain platforms are summarized below.

Table 2.

Comparison of the technical features of the platforms and their applications.3,38

Platform Ethereum Hyperledger Fabric MultiChain
Type of Smart Contract Second Generation Second Generation First Generation
Programming Language Solidity, Serpent, and LLL63 Go and Node.js for Chaincode52 JavaScript for Smart Filter64
Network Permission Permissioned/Permissionless Permissioned Permissioned
Open Source License Go-Ethereum: LGPL v3.0,61 CPP-Ethereum: GPL v3.0,65 Py-Ethereum: MIT License,66 Ethereum J: GPL v3.0,67 and Parity: GPL v3.068 Apache License v2.069 GPL v3.070
Applications MedRec,31,32 Patientory,71,72 Nebula Genomics,73,74 clinical data sharing,75 and patient monitoring.76 Clinical data sharing,77 Institutional Review Boards (IRB) regulation enforcement,78 mobile healthcare,79 and medical data storage/access.80 Privacy-preserving predictive modeling5,7 and its application in anesthesia.6
  • Ethereum. We constructed a blockchain network using Go-Ethereum.61 Then, we sent transactions with specified data and checked the transaction input for both servers were the same. Finally, we wrote, compiled, deployed and executed smart contracts using Solidity40,41 on our blockchain network. An example smart contract pseudo code written in Solidity and executed on Ethereum11,43 is shown in Figure 2, which corresponds to the use case described in Figure 1. The whole process to build the blockchain network took about 30 minutes, while the learning time for an undergraduate student (DW) was about 7 days.

  • Hyperledger Fabric. We built a blockchain network using the Hyperledger Fabric images on Docker.62 Then, we send transactions to verify the connectivity of the network, and implemented/executed smart contracts using Chaincode in the Go language. An example pseudo code, corresponding to Figure 1 (b), is shown in Figure 3. The whole process to build the blockchain network took about 45 minutes, and the overall learning period for an undergraduate student (HY) was about 14 days.

  • MultiChain. We setup a blockchain network using MultiChain.57 Then, we sent transactions between nodes to ensure the validity of the network. We also tried to create data streams to disseminate key-value paired data. Finally, we investigated smart filters, and an example pseudo code is illustrated in Figure 4. The whole process to build the blockchain network took about 30 minutes, while the overall learning period for a graduate student (HS) was about 2 days.

Figure 2.

Figure 2.

Example Ethereum Solidity pseudo code involved in a simple contract between two institutions (as described in Figure 1 (b)). University B deployed this QuerySmartContract, with two functions: sendQuery and getQuery, to the blockchain network. University A executed this smart contract and queried the data for “how many patients have hemoglobin test results for postmenopausal females” (the upper-right box). Then, University A retrieved the query from the blockchain, and can see the query criteria as well as the address of the contract owner (which is University B). Note that it takes some time for the smart contract to be enclosed in a verified transaction of a block, therefore the first query only returns empty values for the query. Also, this smart contract, as well as any function calls that change the state of the variables in the smart contract, will be logged in the immutable blockchain, which enables future attribution, auditing, dispute and resolution for both (and even a third-party) institutions.

Figure 3.

Figure 3.

Example Hyperledger Fabric pseudo code for the example shown in Figure 1 (b), and the execution results are shown in the upper-right box. Similar to the code shown in Figure 2, University B deployed this contract, and University A send the query (by calling sendQuery and getQuery functions).

Figure 4.

Figure 4.

Example MultiChain code between two universities. University A creates a stream query in the blockchain, and publishes a key (patientOutcome only, for simplicity purpose) with a value (hemoglobin, which is represented in hexadecimal number “68656d6f676c6f62696e”) in the stream. Then, University B subscribes the stream to inspect the value of the patientOutcome.

Comparison and Discussion

Based on our implementations, MultiChain is the easiest blockchain platform in terms of setup. The setup of Ethereum as a permissioned network took longer than MultiChain. Hyperledger Fabric contains more layers in its network to increases manageability and security, which can result in long setup time compared to other platforms. The installation of the software prerequisites for MultiChain and Ethereum are also easier comparing to Hyperledger Fabric. On the other hand, Ethereum and Hyperledger provide the full-functional smart contract capability, while the support of smart contract for MultiChain is limited. The smart contracts are highly readable and easily programmable.

Considering the biomedical/healthcare applications, the salient characteristic of the three platforms are as follows. Ethereum is supported and maintained by a large community of developers around the world. This open property makes it a good choice while considering the long-term sustainability of the platform that the applications rely on. Hyperledger Fabric’s well-designed, multi-layered access control framework along with Hyperledger Fabric’s own certificates leads to high versatility, security, and manageability of the blockchain platform. MultiChain is designed to be a permissioned blockchain that is very simple yet powerful to use and inherits proven features of the famous Bitcoin Blockchain by forking from it.

Conclusion

To support the development of healthcare applications based on blockchain and smart contracts, we conducted a pragmatic comparison and evaluation of smart contract blockchain platforms. The main limitation of this study is that we only compared three platforms, so the scope may be restricted. Based on our results, an informatics researcher, IT expert, or technical leader in healthcare or other institution can assess the various practical aspects, such as setup/learning time and unique technical features, of the platforms. The selection of a proper platform depends on requirements of the application (e.g., maintenance for Ethereum, fine-grained access control for Hyperledger Fabric, and rapid-development for MultiChain). Such an assessment can accelerate the process and reduce the risks in adopting blockchain, an immutable, distributed, and automated technology, for biomedical and healthcare applications. We plan to identify more blockchain requirements for healthcare applications, conduct more structured and large-scale comparisons to include additional blockchain platforms (such as Corda81-83) that may fulfill the requirements, and analyze the operation/performance aspects of the platforms in our future work.

Acknowledgements

The authors would like to thank Lucila Ohno-Machado, MD, PhD, and Jejo David Koola, MD, for very helpful discussions and support. Research reported in this publication was supported by the National Human Genome Research Institute (NHGRI), the National Library of Medicine (NLM), and the Office of the Director (OD), National Institutes of Health (NIH). The content is solely the responsibility of the authors and does not necessarily represent the official views of the NIH. All authors were partly funded by NIH, including T-TK (OT3OD025462, K99/R00HG009680), HS (OT3OD025462, K99/R00HG009680), HY (K99/R00HG009680), and DW (T15LM011271). This research benefited from the use of credits from the National Institutes of Health (NIH) Cloud Credits Model Pilot, a component of the NIH Big Data to Knowledge (BD2K) program. T-TK is also funded by the UCSD Academic Senate Research Grant RG084150 and Travel Award TG087935.

Figures & Table

References


Articles from AMIA Annual Symposium Proceedings are provided here courtesy of American Medical Informatics Association

RESOURCES