# SPIN: A Blockchain-Based Framework for Sharing COVID-19 Pandemic Information across Nations
## 2 Design
### Blockchain  
A blockchain is a distributed, decentralized database that groups and processes transactions into a sequence of cryptographically linked blocks. Blockchain has many desired features, such as immutability, decentralization, and transparency, that make it suitable for sharing information between countries. A consensus protocol is implemented for agreement and to append a block of transactions to the blockchain network. A blockchain network may be public, private, or permissioned. A public network, such as Bitcoin [20], is open and allows anyone to join the network and propose transactions. In contrast, a private network permits a predefined set of entities to join the network and propose transactions. A permissioned network sits in the middle between private and public networks, offering a mechanism to permit entities to the network. For our framework, we use a permissioned blockchain network because it has several desirable characteristics that suit our use case. First, participants are identified, which is required to authenticate the shared information. Second, it allows for more scalable consensus protocols, compared to public blockchain networks, which are vulnerable to attacks and have a lower throughput and scalability characteristics [25; 26]. We use Hyperledger Fabric [27; 28] to serve as the underlying permissioned blockchain network because it supports the sending of private data (see Section 2.2 for details). It is possible to select other blockchain platforms with similar features or implement them to fulfill the SPIN functional requirements. Hyperledger Fabric is an open-source permissioned blockchain platform. It is highly modular and configurable for various use case applications. We describe four main components of Hyperledger  
Figure 1: SPIN Framework Overview. Fabric: membership service provider (MSP), clients, peers, and orderers (see Figure 2). The MSP component is responsible for establishing and verifying the cryptographic identities of entities in the permissioned blockchain network using a public key infrastructure (PKI) [29; 30]. Clients represent end-users and submit transaction invocations to peers. Peers execute and commit transactions. They maintain a copy of the blockchain and a private database recording the current state of the blockchain modeled as a key-value store. Orderers form the ordering service that implements the consensus protocol and provides communication and delivery guarantees. The life cycle of transactions in Hyperledger Fabric follows an execute-order-validate model. First, peers execute, check, and approve transactions. Second, the ordering service orders transactions using the implemented consensus protocol. Last, before committing the transactions, peers validate them with their defined endorsement policies. An endorsement policy specifies the set of peers that must execute and approve a transaction to be considered valid. Each country is represented as a peer in our blockchain network and has an MSP to enroll and authenticate members of the blockchain network and their transactions. Entities that are involved in issuing and verifying COVID-19 certificates are represented as clients. Those clients issue transactions that are executed by their peers on the network. Blockchain transactions read and write data items for sharing COVID-19 information between countries. These data items are represented as key-value pairs key = K, value = V and classified into private and public data, as detailed in Section 2.2. For our implementation, we employ Raft [31] as a consensus protocol for the blockchain network. Raft uses a leader-follower model to replicate transactions. A leader node is elected to process transactions and replicate them to other nodes. It offers several advantages, such as immediate finality and a fast block time. Raft is crash-fault-tolerant and continues to operate as long as the majority of nodes are running.