# A Privacy-Preserving Record Linkage Method Based on Secret Sharing and Blockchain
## 4 Methods
### Data Preparation and Generation Module
#### 4.2.5 Data Distribution
After downloading data based on the index table, each computing node independently performs local difference calculations, Boolean-to-arithmetic share conversions, and partial Hamming distance result generation. For a pair of records \(\left(BFA_{i,j},BF_{i,j}\right)\), the node processes each bit \(l\) (\(l\) from \(1\) to \(m\)) using obfuscated Boolean shares \(\left[a_{i,j,l}\right]_{B}^{\pi_{\text{gold}}(k)}\) and \(\left[b_{i,j,l}\right]_{B}^{\pi_{\text{gold}}(k)}\) to compute the local difference \(\left[d_{i,j,l}\right]_{B}^{k}\). Through a modified B2A protocol, \(\left[d_{i,j,l}\right]_{B}^{k}\) is converted to an arithmetic share \(\left[d_{i,j,l}\right]_{A}^{k}\), which is accumulated to generate the partial Hamming distance share \(\left[D_{i,j}\right]_{A}^{k}\). The random permutation mechanism is applied throughout the process to ensure data privacy. The specific steps are as follows. #### 4.3.1 Local Difference Calculation and Masked Difference Vector Generation

The computation of the approximate matching module begins with the Boolean shares of local differences. Each computing node \(N_{k}\) performs an XOR operation for each bit \(l\) (where \(l\) ranges from \(1\) to \(m\)) to calculate the Boolean share of the local difference. The computation formula is as follows:

\[\left[d_{i,j,l}\right]_{B}^{k}=\left[a_{i,j,l}\right]_{B}^{\pi_{\text{gold}}(k )}\oplus\left[b_{i,j,l}\right]_{B}^{\pi_{\text{gold}}(k)} \tag{6}\]

Due to the random permutation \(\pi_{\text{gold}}\) introduced in data distribution, the node processes obfuscated Boolean shares. However, the properties of the XOR operation ensure that the result is independent of the order, and the shares from all \(t\) nodes satisfy

\[d_{i,j,l}=\bigoplus_{k=1}^{t}\left[d_{i,j,l}\right]_{B}^{k} \tag{7}\]

Subsequently, node \(N_{k}\) uses pre-generated Boolean mask shares \(\left[r_{\text{gold},l}\right]_{B}^{\pi_{\text{gold}}(k)}\) (corresponding to group gid) to compute the masked difference vector \(E_{k}=\left(e_{1,k},e_{2,k},\ldots,e_{m,k}\right)\) for all \(m\) bits. The masked difference for each bit is defined as follows:

\[e_{l,k}=\left[d_{i,j,l}\right]_{B}^{k}\oplus\left[r_{\text{gold},l}\right]_{B }^{\pi_{\text{gold}}(k)} \tag{8}\]

The permutation mechanism ensures that the masks correctly correspond to the Boolean shares, thereby guaranteeing the correctness of the computation results while protecting data privacy. #### 4.3.2 Batch Interaction and Data Sharing

Nodes share masked difference vectors in batches. Node \(N_{k}\) uploads its vector \(E_{k}\) (a Boolean sequence of length \(m\)) to IPFS, obtaining the content identifier \(\text{cid}_{E_{k}}\). It then submits the task identifier and \(\text{cid}_{E_{k}}\) to the smart contract to record the upload. The smart contract logs these submissions and, once all \(t\) nodes have submitted, notifies relevant nodes by triggering an event (containing the task identifier, node identifiers, and corresponding content identifier list) or updating the task status [28]. Node \(N_{k}\) monitors blockchain events or queries the task status to confirm that all \(t\) nodes have completed submissions. Upon confirmation, it retrieves the content identifiers of the other \(t-1\) nodes (e.g., \(\text{cid}_{E_{1}},\ldots,\text{cid}_{E_{k-1}},\text{cid}_{E_{k+1}},\ldots, \text{cid}_{E_{t}}\)) from the smart contract and downloads the corresponding vectors \(E_{1},\ldots,E_{k-1},E_{k+1},\ldots,E_{t}\) via IPFS. The random permutation \(\pi_{\text{gold}}\), recorded in the index table, allows the node to restore the correct order of downloaded data, ensuring consistency. #### 4.3.3 Masked Difference Reconstruction and Conversion

After obtaining the masked difference vectors from all nodes, node \(N_{k}\) performs local reconstruction and Boolean-to-arithmetic share conversion.