# Development of an Electronic Smart Safe Box Using Private Blockchain Technology
## 3 Materials and Methods  
Blockchain technology is categorized into two categories: (1) public and (2) private. This research focused on the private blockchain because the private blockchain allows the sensitive data only seen by selected permitted users and no need for mining as a public blockchain. In addition, a blockchain is a digital ledger of each block of transactions with duplicates and distributes across the entire network of computer systems known as nodes. Also, blockchain by its nature is a transformative technology with a digital form of record-keeping that organizes information added to the ledger into blocks or data groups. Further, the individual blocks are designed to hold a certain amount of data; thus, new blocks keep adding to the ledger continually, leading to the formation of a chain to structure the data as a linked list. Moreover, each block has its unique identifier, a hash algorithm that protects not only the information contained in a block but also the place of the block along the chain by identifying the previous block before it. Also, once the block data has been added to the chain in the private blockchain, it is encrypted using a standard hash algorithm, which becomes permanent and unchangeable. Communications between components are known as transactions. There are different transactions in the private blockchain-based smart safe box, each designed for a specific function. For example, a store transaction is generated by components to log data and an access transaction is generated by the user to access the smart safe box. The implementation of blockchain in this research is to add the transactional chain logged into a database when the user with permission wants to see the data logged in the data logs. Also, the blockchain utilizes the standard encryption algorithm to make it more confidential in each transaction chain. Further, the blockchain helps secure data to be stored and thus can be applied in a smart safe box. Further, blockchain data have three aspects of data structure, data model and datastore, and a consensus mechanism as presented in [34; 35; 36; 37]. Further, each block is saved in chronological order with a block header, policy header, and block body. The block body records all the transactions started from the motion sensor until the box is closed or ends with no motion. Also, block body logs contain time, date, picture, video, and transaction ID to protect the standard hash algorithm for each block transaction. Figure 1 shows how the private blockchain implementation design works and it starts with:  
1. The user opens the box using the three-way methods (face recognition, fingerprint, or keypad password). 2. The user adds the items inside the box, and the optical detector detects these items and stores them in the block. 3. Collect the data. 4. Save the data in the private blockchain. 5. Use the logs option to access data if needed. As shown in Figure 1, the private blockchain concept used in the implementation of the proposed smart safe box consists of three blocks i.e., (1) Genesis Block 1, (2) Block 2, and (3) Block 3. The working concept of each of these blocks is given below. * GENESIS BLOCK 1 \(\bigcirc\) & Contain hash for itself data \(\bigcirc\) & User entry log \(\bigcirc\) & Items were detected \(\bigcirc\) & Time
* BLOCK 2 \(\bigcirc\) & Contain hash for itself data \(\bigcirc\) & Previous hash \(\bigcirc\) & User entry log \(\bigcirc\) & Items were detected \(\bigcirc\) & Time
* BLOCK 3 \(\bigcirc\) & Contain hash for itself data \(\bigcirc\) & Previous hash \(\bigcirc\) & User entry log \(\bigcirc\) & Items were detected \(\bigcirc\) & Time
* BLOCK 4 \(\bigcirc\) & Data \(\bigcirc\) & Data \(\bigcirc\) & Data \  
Figure 2 explains the flowchart used for the smart safe box system. Each transaction is saved in the blockchain ledger at each block logs transaction.