# A Lightweight Hash-Based Blockchain Architecture for Industrial IoT
## 3 Proposed Lightweight Hash Based Blockchain Architecture for IIoT
### Network Interaction Process  
In the proposed architecture, the blockchain network is located between the field Layer and the control Layer of the IIoT network; the blockchain network consists of the cell node and storage node, as mentioned before. These nodes transfer the data between field devices and control devices like a bridge. In the transferring process, they perform block mining and updating for data integrity. In the network, the interaction process is separated into two parts (Device Registration Process and Data Transferring Process), please find the entire interaction process in Figure 3. The detailed description of each process is as follows. The device registration process is a process that the requested device link to the blockchain network. First, the device sends the registration request with their identification number (\(id_{FD_{n}}\): identification number of \(n\)-th field device; \(id_{CD_{n}}\): identification number of \(n\)-th control device) and pre-shared signature of cell which is nearly located (\(signature_{cell_{n}}\): \(n\)-th cell signature). The identification number and cell signature are unique identifiers that are assigned to each device and the cell. It is used to figure out what devices are included in a cell, and this information is stored in device manager of cell node as a list (\(list_{D}EV\)). Then, the cell node, which received a registration request from devices performs the device management function of the device manager. In this process, the device manager compares the pre-shared signature with its cell signature (\(signature_{own}\)). If the  
Figure 3: Proposed architecture interaction process. signature is matched, the device manager adds the device identification number to the device list. Algorithm 1 represents the device registration process  
```
Input :\(id_{PD_{n}},signature_{cell_{n}}\) Output :success or fail
1 Procedure \(REGIST2 CELL(id_{PD_{n}},signature_{cell_{n}})\)
2 if\(signature_{cell_{n}}=signature_{own}\)then
3\(list_{DEV}\gets list_{DEV}|id_{PD_{n}}\)
4 returnsuccess
5 else
6 returnfail
7 endif
8 End Procedure
```  
**Algorithm 1**Device Management  
The data transferring process is a process where the cell node gathers the data needing to be processed from devices and performs block mining, block validation, and updating of the ledger in storage node. First, in this process, the cell node gathers the sensing data from field devices, also gathers the control command from control devices in a predefined time interval (\(t\)). Then, the cell node process the gathered data to transactions (\(transactions_{i}\)) and performs the block mining management function. Block mining management consists of 2 procedures. First one is the selection of lightweight hash function. The hash function is selected by comparing the number of transaction to the predefined threshold (\(h_{1},h_{2}\)). Another one is the mining process that finds a nonce that satisfies target difficulty by calculating the hash value (\(Hash(B_{i})\)) to the block (\(B_{i}\)). This procedure is basically the same \"PoW\". When the right nonce is founded, the cell node requests validation of the block to other nodes in the blockchain network (\(BroadcastBVM(B_{i})\)), and waits for the response which contains the result of validation. Besides, other nodes that received a block validation request perform the block validation management function, and then check whether a requested block is correctly synchronized and whether the nonce satisfies the target difficulty. The synchronization checking is performed by comparing the previous hash value of the requested block to the stored previous hash value in the node, and the nonce checking is performed by calculating the hash value. If the validation result is true, the block validation management broadcasts the result, and the stored previous hash value is updated. You can see the block mining management process in Algorithm 2. Also, please see the validation management process in Algorithm 3.