# Blockchain-Based Distributed Computing Consistency Verification for IoT Mobile Applications
## 6 The Proposed BDCA
### Data Processing  
In this phase, \(DO_{S}\) first preprocesses the original data \(M\) and constructs the BV-MHT and auxiliary verification information form (AVF). Then, \(DO_{S}\) uploads the processed datasets to \(SC\) for storage, the specific steps are shown as follows:  
* Given a original data file \(M\in\{0,1\}^{*}\), \(DO_{S}\) splits \(M\) into \(k\) blocks, represented as \(m_{ii\in[1,k]}\). Note that if the last block is not the same size as the other blocks, \(DO_{S}\) pads 0 at the end of the last block. In order to protect the security and privacy of \(M\), \(DO_{S}\) applies a blind signature technique by creating a blinded version of \(M\), denoted as \(M^{*}\), with \(\{m^{*}_{i}\}_{i\in[1,k]}=\{m_{i}\}_{i\in[1,k]}+H_{1}(md||a_{d})\), where \(md\in\{0,1\}^{*}\) is the unique identification of \(M\), \(a_{d}\in\mathcal{Z}_{N}\) is a random number, and \(H_{1}\) is a one-way hash function. Additionally, \(DO_{S}\) calculates a verification value \(A_{d}=g^{a_{d}}\), where \(g\) is a generator of a cyclic group \(\mathcal{G}\), and \(N\) is the order of \(\mathcal{G}\). * \(DO_{S}\) constructs the batch verification Merkle hash tree (BV-MHT) based on the processed data to facilitate efficient and secure data auditing. In BV-MHT, each node \(\
u\) stores a tuple \((l_{\
u},r_{\
u},h_{\
u})\), which represents the position information of the node \(\
u\) in BV-MHT. Specifically, if the node \(\
u\) is the \(i\)-th leaf node \(\tau_{i}\), \(r_{\
u}\) is set to 1 and \(h_{\
u}=H_{1}(m^{*}_{i})\). If the node \(\
u\) is a non-leaf node \(\chi\), \(r_{\
u}\) stores the number of the leaf nodes that \(\chi\) can reach from the left to right and \(h_{\
u}=H_{1}(r_{\
u}||h_{left_{x}}||h_{right_{x}})\), where \(h_{left_{x}}\) and \(h_{right_{x}}\) denote the left and right child nodes of \(\chi\)[37]. If the node \(\
u\) is the left child node of its parent node, \(l_{\
u}\) is set to 0; the node \(\
u\) is the right child node of its parent node, \(l_{\
u}\) is set to 1; the node \(\
u\) is the root of the BV-MHT, \(l_{\
u}\) is set to 2. The process of constructing BV-MHT is shown in Figure 2 and the nodes \(\{\tau_{2},\tau_{4},\tau_{7}\}\) are verified simultaneously. * \(DO_{S}\) constructs the auxiliary verification information form (AVF) to implement the batch verification and accelerate the process of batch verification. In traditional MHT, the \(i\)-th leaf node can only be verified one by one with its siblings on the path from the \(i\)-th leaf node to the root. For instance, if the nodes \(\{\tau_{2},\tau_{4},\tau_{7}\}\) want to be verified simultaneously, they need to generate the auxiliary verification information \(\omega_{\gamma_{2}}=\{\tau_{1},\chi_{10},\chi_{14}\}\), \(\omega_{\tau_{4}}=\{\tau_{3},\chi_{9},\chi_{14}\}\), and \(\omega_{\gamma}=\{\tau_{8},\chi_{11},\chi_{13}\}\), respectively. The node \(\chi_{14}\) will be retrieved twice, which will cause more overhead. Furthermore, as the number of verified nodes simultaneously increases, the number of duplicate retrieval nodes increase. From the perspective of saving verification overhead, we introduce a concept auxiliary verification information form (AVF) in BV-MHT, as an example is shown in Table 2, the nodes \(\{\tau_{2},\tau_{4},\tau_{7}\}\) can be verified simultaneously by retrieving the AVF\({}_{r\times t}\), where \(r\) is the number of the nodes verified simultaneously, \(t\) is the max layer of the leaf nodes in BV-MHT, and \(Point\) is a point that points to the different line in AVF\({}_{r\times t}\). The specific procedures of constructing AVF\({}_{r\times t}\) are shown in Algorithm 1. Finally, \(DO_{S}\) invokes Algorithm 1 to generate an AVF\({}_{1\times t}(v_{k})\) for the last leaf node \(v_{k}\). * \(DO_{S}\) generates the authenticated tags of the transferred data \(\{m^{*}_{i}\}_{i\in[1,k]}\) with Equation (1) and uploads the datasets \(DS_{1}=\{(m^{*}_{i},\zeta_{i})\}_{i\in[1,k]}\), \(\{k,h_{root}\}\), \(\{v_{k},\text{AVF}_{1\times t}(v_{k})\}\}\) to \(SC\) for storage.