# A Privacy-Preserving Record Linkage Method Based on Secret Sharing and Blockchain
## 4 Methods
### Data Preparation and Generation Module
#### 4.2.5 Data Distribution
Specifically, it includes the following: \(\text{CID}_{s_{\pi_{k}(j)}}\); CID of the \(\pi_{k}(j)\)-th Boolean secret share of \(B_{A}\); \(\text{CID}_{s_{\pi_{k}(j)}}\); CID of the \(\pi_{k}(j)\)-th Boolean secret share of \(B_{B}\); \(\text{CID}_{m_{g_{\pi_{k}(j)}}}\); CID of the \(\pi_{k}(j)\)-th Boolean share of the \(g\)-th mask group; \(\text{CID}_{d_{g_{\pi_{k}(j)}}}\); CID of the \(\pi_{k}(j)\)-th arithmetic share of the \(g\)-th mask group; \(\text{CID}_{[1]_{A,\pi_{k}(j)}}\); CID of the \(\pi_{k}(j)\)-th arithmetic share of the constant \"1\"; \(\pi_{k}\): the complete random permutation function corresponding to compute node \(c_{k}\). The smart contract iterates through all record pairs to be processed, the \(t\) compute nodes assigned to each pair, and the \(t\) logical share indices \(j\) for each node. It computes the mapped physical index \(\text{mapped}_{j}=\pi_{k}(j)\), retrieves or combines the corresponding CIDs, and stores this information as key-value pairs in the index table. The algorithm for data distribution is described in pseudocode as Algorithm 1. ```
0: record_pairs: List of record pairs to be processed; k: Number of mask groups; n: Number of computation nodes per record pair; total_nodes: Total selected computation nodes Output: index_table: Mapping of tasks to computation nodes with CIDs and permutations
1:for each record_pair in record_pairs do
2: group_id \(\leftarrow\) DeterministicHash(record_pair) mod k
3: selected_nodes \(\leftarrow\) VRFSelectNodes(total_nodes, n)
4:for each node in selected_nodes do
5: perm \(\leftarrow\) VRFGeneratePermutation(n, seed = (record_pair, node))

Figure 3: The process of random permutation. In Algorithm 1, lines 1-3 iterate through record pairs, group them via hashing, and randomly select computing nodes for each pair. Lines 4-9 generate a random permutation for each node, compute physical share indices, create task key-value pairs, and populate the index table. Lines 10-13 store the index table on the blockchain and return. ### Approximate Matching Module

The core task of the approximate matching module is to securely and efficiently compute the similarity between records in a distributed environment, using secret shares and masked data generated by the data preparation and generation module, with hamming distance as the metric. The main process includes data acquisition, local difference computation, Boolean-to-arithmetic share conversion, and the generation of partial Hamming distance results. The module relies on local collaboration among multiple computing nodes to perform matching computations, optimizing storage and distribution efficiency through the collaboration of blockchain and IPFS [27]. The data processing of this module is illustrated in Figure 4, taking the processing of a single computing node as an example:

The index table generated by the data distribution smart contract is recorded on the blockchain. This action ensures the transparency, immutability, and auditability of the data distribution process. Based on the assigned task \((g,(B_{A},B_{B}),j)\), computing node \(c_{k}\) queries the index table on the blockchain to obtain the CIDs of the data shares required to complete its task, along with its own random permutation \(\pi_{k}\). Subsequently, the computing node can asynchronously download these data shares from IPFS to prepare for approximate matching computations. To enhance security and resistance to collusion, this module adopts a multi-node decentralized strategy, with the number of computing nodes \(t\) significantly exceeding the number of shares. The data distribution smart contract randomly allocates data based on participants, records, and attributes, ensuring high data dispersion. Even if some nodes collude, it is difficult to gather enough shares to reconstruct the original information. Figure 4: The data processing of the approximate matching module. The computation process centers on localized operations.