# DynamiChain: Development of Medical Blockchain Ecosystem Based on Dynamic Consent System
## 4 Implementation
### Security Management System  
Blockchain security comprises mainly confidentiality, integrity, availability (CIA) [38]. DynamiChain also meets the CIA by complementing the existing public blockchain model. Since information is open and cannot be restricted from participating in the traditional public blockchain, it is very difficult to meet consistency. DynamiChain uses private blockchain's channel to meet confidentiality by only allowing pre-selected participants to join the network. Moreover, not only are digital certificates safely managed by applying Fabric-CA, but also sensitive data are encrypted by implementing Private Data Collection (PDC). In the existing public blockchain, Public Key Infrastructure (PKI) based on hash algorithms is used to prevent the manipulation of the block, and each block stores the information of not only the current block, but also the previous block. DynamiChain also take advantage of the existing public blockchain's attribute. In addition, DynamiChain increases its integrity by requiring all the peers to periodically verify the current block state before adding a new block, therefore, reducing the possibility of peer hacking. In the traditional blockchain, as well as DynamiChain, data are accessible from the rest of the nodes even if one node is not working. All nodes are kept and decentralized with the same contents, preventing a single point of failure to gain availability. Furthermore, from the generation of transactions process to the consensus process, it can be processed individually in stages, which improves the performance by allowing parallel processing to perform more than one task at the same time. A user management system and a key management system are the two main components of the security management system. The user management system (Figure 6) manages the actual users for creating, blocking, and deleting (Figure 6a) data providers and data utilizers. Data providers can create additional accounts under a dynamic consent framework by requesting the super administrator. Data utilizers can also create additional accounts by requesting the super administrator (Figure 6b) by specifying the purpose of data usage information (e.g., clinical, research, and healthcare). Figure 6c shows the DynamiChain interface of the user management system implementation screen showing the management list according to the user type. The functions for managing the permissions of data providers and data utilizers were implemented in the super administrator account. A super administrator can create, block, and disable accounts of the data provider and user. If a user is created, a key in the blockchain is also generated. If a user is blocked, it is impossible to login to the system. The data provider sets the access permissions of the data according to the dynamic consent system. The data utilizer manages and utilizes the data according to the access permission set by the data provider. The key management system requires a key to sign the blockchain for each user. The key to the data provider is generated when he or she joins the web service (Figure 7a). The ECDSA algorithm was used to generate private and public keys. The generated keys are stored in a key-store-only wallet within the server (Figure 7b). The keys of the super administrator and the user are distinguished. For security purposes, each user maintains the key in a separate wallet. In Table 3, medical blockchain-related studies (2016 to 2020) were reviewed to prove the novelty of the system in terms of dynamic applicability and expandability. Figure 6: DynamiChain interface of the user management system. (**a**) User selection tab (data provider/data utilizer). (**b**) User management button (create/block/delete). (**c**) User list. Figure 7: Dynamichain interface of the key management system. (**a**) Web screen and (**b**) server screen.