# A Comparison of Blockchain Recovery Time in Static and Mobile IoT-Blockchain Networks
## 3 Background of IoT-Blockchain with Ad Hoc Network  
### Ethereum Blockchain  
In this investigation, the IoT-blockchain systems include blockchain applications and several IoT devices. Some examples of IoT-blockchains considered in this research include smart home (for static scenarios) and smart community (for mobile scenarios) [30]. In the former, the blockchain deployment is straightforward and has been investigated elsewhere. In the latter, the smart community utilizes wireless sensor networks, mobile networks, and other communication technologies to integrate security, property management and other systems to provide a safe, comfortable and convenient modern living environment for community residents. The protection of community residents' identity information faces security problems, such as privacy leakage and identity fraud. The high reliability, traceability, and difficulty of tampering with blockchain can protect the security of residents' identity information. A smart contract may trigger transactions when the resident's privacy information is updated or uploaded. In such a case, a single point of failure should be avoided. Moreover, if a failure does happen, the IoT-blockchain should be automatically recovered. In this investigation, we use Ethereum, which has a set of virtual machines (EVM) that can execute a Turing-complete scripting language and smart contract. A smart contract is a piece of code written on the blockchain, which can be automatically executed once an event triggers the terms in the contract. In other words, it can be triggered when conditions are met without human control. In the Ethereum blockchain, there are normal nodes and miner nodes. The miner nodes prove the correctness of a transaction and record it on the blockchain. Then, all the nodes will work together to maintain and store the transaction data through a consensus mechanism. The best-known and most widely used consensus mechanism is Proof of Work (PoW). In PoW, the miner nodes compute a \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Underlying** & **Application** & \begin{tabular}{c} **Evaluation** \\ **Environment** \\ \end{tabular} & **Network State** & **Characteristic** & **Ref.** \\ \hline Infrastructure-based & \begin{tabular}{c} Combining IoT and blockchain \\ for smart home \\ \end{tabular} & Simulation & Static & \begin{tabular}{c} Propose a \\ blockchain- \\ based smart \\ home gateway \\ \end{tabular} & [28] \\ \hline Ad hoc & \begin{tabular}{c} Combining IoT \\ and blockchain \\ for UAVs \\ \end{tabular} & Real & Mobile & \begin{tabular}{c} Propose a \\ blockchain- \\ based \\ distributed key management \\ scheme for \\ FANET \\ \end{tabular} & [29] \\ \hline Ad hoc & \begin{tabular}{c} Combining IoT and blockchain \\ \end{tabular} & Real & Static & \begin{tabular}{c} Evaluate the \\ recovery time \\ of OLSR in a \\ small network \\ \end{tabular} & [11] \\ \hline Ad hoc & \begin{tabular}{c} Combining \\ blockchain and IoT \\ \end{tabular} & \
\begin{tabular}{c} Emulation and \\ Real \\ \end{tabular} & Static and mobile &
\begin{tabular}{c} Evaluate communication \\ recovery \\ performance of \\ OLSR, \\ BATMAN, \\ BABEL \\ \end{tabular} & This study \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Comparison of this study with previous studies. mathematical problem to find a random number (called nonce) that satisfies the block-out requirement. If the miner finds a nonce value that meets the need, it can successfully generate a new block on the blockchain and receive a corresponding reward. This process is known as mining. In an IoT-blockchain network, when a node completes a transaction, it uploads it to its transaction pool (txpool) to queue it for verification. It also broadcasts the transaction to its peer nodes via P2P communication. Its peers continue to broadcast transactions to their peers so that all nodes in the entire IoT-blockchain network can receive the transaction and deposit it into their txpools.