# 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 compute nodes are selected, the blockchain triggers the data distribution smart contract to coordinate the allocation of data shares stored on IPFS, preparing for approximate matching computations. The core process includes record pair grouping, compute node assignment, random permutation, and data index table generation. Record Pair Grouping and Input Preparation: The contract retrieves CIDs for task-required data, including Boolean secret shares of Bloom filters uploaded by participants; system-generated mask Boolean shares, mask arithmetic shares, and arithmetic shares of the constant 1; list of selected compute nodes; system parameters: number of mask groups \(K\), number of compute nodes/shares per record pair \(t\), and total selected nodes \(N\). To improve efficiency and enable mask reuse, the contract divides record pairs into \(K\) groups using a deterministic hash function, with all pairs in the same group sharing the same mask set. Compute Node Assignment and Random Permutation: For a record pair \((B_{A},B_{B})\), assumed to belong to group \(g\), the contract assigns \(t\) compute nodes to process its \(t\) secret shares. Using a Verifiable Random Function (VRF) with seed \(\text{seed}=\text{concat}(g,A_{\text{id}},B_{\text{id}})\), it randomly selects \(t\) nodes from \(N\), denoted as selected\(\_\)nodes \(=\{c_{1},c_{2},\ldots,c_{t}\}\). To prevent collusion attacks among nodes, a random permutation mechanism is introduced to obfuscate the logical numbering of shares, breaking their direct association with original data. For each selected node \(c_{k}\) (\(k=1,2,\ldots,t\)), the contract generates a unique permutation \(\pi_{k}\) using VRF with seed \(\text{seed}=\text{concat}(g,A_{\text{id}},B_{\text{id}},k)\), reordering the set \(\{1,2,\ldots,t\}\). For example, when \(t=3\), \(\pi_{k}\) might be \([2,3,1]\). When node \(c_{k}\) processes logical share \(j\) (\(j=1,2,\ldots,t\)), it retrieves the physical share index:  
\[\text{mapped}_{j}=\pi_{k}(j). \tag{5}\]  
For instance, if \(\pi_{k}=[2,3,1]\), logical share \(j=1\) corresponds to physical share \(2\), \(j=2\) to physical share \(3\), and \(j=3\) to physical share \(1\). Random permutation, by generating a unique mapping for each node, disrupts fixed share assignments, significantly reducing the risk of colluding nodes inferring original data. The permutation process, driven by VRF, ensures randomness and verifiability, guaranteeing fair and auditable allocation while maintaining computational efficiency, as it only involves index remapping without requiring additional cryptographic operations. The random permutation algorithm process is shown in the following Figure 3:  
Data Index Table Generation: One of the core tasks of data distribution is generating an index table and storing it on the blockchain. This index table precisely records the allocation details for each computational task, specifying which computing node is responsible for processing which logical share of which record pair, along with the specific data required to complete the task. The index table is typically a key-value store, with keys defined as the tuple \((g,(B_{A},B_{B}),k,j)\), where \(g\) is the mask group number for the record pair, \((B_{A},B_{B})\) is the record pair identifier, \(k\) identifies the compute node \(c_{k}\), and \(j\) is the logical share index (from 1 to \(t\)). The value contains the CIDs of all data required to complete task \((k,j)\), along with the node's permutation information.