# A Lightweight Hash-Based Blockchain Architecture for Industrial IoT
## 3 Proposed Lightweight Hash Based Blockchain Architecture for IIoT
### Network Interaction Process
```
Input :\(transactions_{i}=(id_{FD_{1}},data_{FD_{1}})|(id_{FD_{2}},data_{FD_{2}})|...|(id_{ FD_{n}},data_{FD_{n}})\) Output :success or fail
1 Procedure SELECTHASH(transactions_{i}) if\(sizeof(transactions_{i})<h_{1}\)then
2 Hash \(\leftarrow\) SPONGENT elseif\(h_{1}<sizeof(transactions_{i})<h_{2}\)then
3 Hash \(\leftarrow\) PHOTON else
4 Hash \(\leftarrow\) QUARK endif
5 End Procedure
6 ProcedureMINING(transactions_{i})  Initialize(\(B_{i}\)) \(B_{i}\).PreviousBlockHash \(\leftarrow\) PreviousBlockHash \(B_{i}\).HashHelper \(\leftarrow\) Hash \(B_{i}\).Nonce \(\leftarrow\) 0 whileHash(\(B_{i}\)) < difficultydo
7\(B_{i}\).Nonce++ endwhile
8\(v\leftarrow\) BroadcastBVM(\(B_{i}\)) if\(v\ =\ true\)then
9 PreviousBlockHash \(\leftarrow\) Hash(\(B_{i}\)) returnsuccess
10 else
11 returnfail endif
12 End Procedure
```  
**Algorithm 2**Block Mining Management  
```
Input :a requested block \(B_{i}\) Output :true or false
1 Procedure VALIDATE(\(B_{i}\)) if\(B_{i}\).PreviousBlockHash \(\
eq\) PreviousBlockHashthen
2 returnfalse
3 Hash \(\leftarrow\)\(B_{i}\).HashHelper
4 difficulty \(\leftarrow\)\(B_{i}\).difficulty
5 ifHash(\(B_{i}\)) < difficultythen
6 PreviousBlockHash \(\leftarrow\)\(B_{i}\).PreviousBlockHash
7 ifstorage nodethen
8 Update(\(B_{i}\)) returntrue
9 else
10 returnfalse
11 endif
12
13 endprocedure
```  
**Algorithm 3**Block Validation Manager  
```
Input :a requested block \(B_{i}\) Output :true or false
1 Procedure VALIDATE(\(B_{i}\)) if\(B_{i}\).PreviousBlockHash \(\
eq\) PreviousBlockHashthen
2 returnfalse
3 Hash \(\leftarrow\)\(B_{i}\).HashHelper
4 difficulty \(\leftarrow\)\(B_{i}\).difficulty
5 ifHash(\(B_{i}\)) < difficultythen
6 PreviousBlockHash \(\leftarrow\)\(B_{i}\).PreviousBlockHash
7 ifstorage nodethen
8 Update(\(B_{i}\)) returntrue
9 else
10 returnfalse
11 end if
12
13 endprocedure
```  
**Algorithm 4**Block Validation Manager  
```
Input :a requested block \(B_{i}\) Output :true or false
1 Procedure VALIDATE(\(B_{i}\)) if\(B_{i}\).PreviousBlockHash \(\
eq\) PreviousBlockHashthen
2 returnfalse
3 Hash \(\leftarrow\)\(B_{i}\).HashHelper
4 difficulty \(\leftarrow\)\(B_{i}\).difficulty
5 ifHash(\(B_{i}\)) < difficultythen
6 PreviousBlockHash \(\leftarrow\)\(B_{i}\).PreviousBlockHash
7 ifstorage nodethen
8 Update(\(B_{i}\)) returntrue
9 else
10 returnfalse
11 end if
12
13 endprocedure
```  
**Algorithm 5**Block Validation Manager  
```
Input :a requested block \(B_{i}\) Output :true or false
1 Procedure VALIDATE(\(B_{i}\)) if\(B_{i}\).PreviousBlockHash \(\
eq\) PreviousBlockHashthen
2 returnfalse
3 Hash \(\leftarrow\)\(B_{i}\).HashHelper
4 difficulty \(\leftarrow\)\(B_{i}\).difficulty
5 ifHash(\(B_{i}\)) < difficultythen
6 PreviousBlockHash \(\leftarrow\)\(B_{i}\).PreviousBlockHash
7 ifstorage nodethen
8 Update(\(B_{i}\)) returntrue
9 else
10 returnfalse
11 end if
12
14 endprocedure
```  
**Algorithm 6**Block Validation Manager  
```
Input :a requested block \(B_{i}\) Output :true or false
1 Procedure VALIDATE(\(B_{i}\)) if\(B_{i}\).PreviousBlockHash \(\
eq\) PreviousBlockHash then
2 returnfalse
3 Hash \(\leftarrow\)\(B_{i}\).HashHelper
4 difficulty \(\leftarrow\)\(B_{i}\).difficulty
5 ifHash(\(B_{i}\)) < difficultythen
6 PreviousBlockHash \(\leftarrow\)\(B_{i}\).PreviousBlockHash
7 ifstorage nodethen
8 Update(\(B_{i}\)) returntrue
9 else
10 returnfalse
11 end if
12
13 endprocedure
```  
**Algorithm 7**Block Validation Manager  
```
Input :a requested block \(B_{i}\) Output :true or false
1 Procedure VALIDATE(\(B_{i}\)) if\(B_{i}\).PreviousBlockHash \(\
eq\) PreviousBlockHash then
2 returnfalse
3 Hash \(\leftarrow\)\(B_{i}\).HashHelper
4\(\leftarrow\)\(B_{i}\).HashHelper
5\(\leftarrow\)\(B_{i}\).HashHelper
6\(\leftarrow\)\(B_{i}\).HashHelper
7\(\leftarrow\)\(B_{i}\).HashHelper
8\(\leftarrow\)\(B_{i}\).HashHelper
9\(\leftarrow\)\(B_{i}\).HashHelper
10\(\leftarrow\)\(B_{i}\).HashHelper
11\(\leftarrow\)\(B_{i}\).HashHelper
12\(\leftarrow\)\(B_{i}\).HashHelper
```
Input :a validated \(B_{i}\) Output :a updated shared ledger \(L\)
1 Procedure Update(\(B_{i}\))
2 ifsizeof(\(L+B_{i}\)) < capacitythen
3\(L\gets L\,|\,B_{i}\) return\(L\)
4 else
5\(L\leftarrow\) DeleteOld(\(L\))
6\(L\gets L\,|\,B_{i}\)
7 return\(L\)
8 endif
9
10 End Procedure
```

**Algorithm 4**Block Update Management

## 4 Analysis

### Simulation Results

In the proposed blockchain architecture, each block is connected by different lightweight hash functions, which are selected from the lightweight hash list according to the number of transactions.