# A Privacy-Preserving Record Linkage Method Based on Secret Sharing and Blockchain
## 4 Methods
### Data Preparation and Generation Module
#### 4.2.4 Compute Node Selection  
After masks and secret shares are uploaded to IPFS, the blockchain triggers the compute node selection smart contract to choose a suitable set of nodes for executing record linkage tasks efficiently and securely [26].  
A reputation-based evaluation mechanism is executed by on-chain validation nodes. From \(N\) candidate nodes, \(k\) nodes (\(\{n_{1},n_{2},\ldots,n_{k}\}\)) are selected, with \(k\) determined through negotiation by the task requester. Validation nodes assess each node \(i\) based on three key metrics: reputation score \(C_{i}\in[-1,1]\), indicating trustworthiness; computational power \(P_{i}\in[0,1]\), normalized to reflect hardware performance; and task completion rate \(R_{i}\in[0,1]\), representing the proportion of successfully completed tasks, measuring execution stability. New nodes, lacking historical data, start with \(C_{i}=0\), \(P_{i}=0\), \(R_{i}=0\). The selection results are synchronized on the blockchain via a consensus mechanism (e.g., PBFT), ensuring consistency and transparency [10].  
An audit verification contract dynamically updates and stores node parameters \(C_{i}\), \(P_{i}\), and \(R_{i}\). New nodes begin with \(C_{i}=0\), \(P_{i}=0\), \(R_{i}=0\), and the contract periodically updates these based on task execution logs (e.g., completion time, result accuracy), ensuring parameters accurately reflect node performance and provide a reliable basis for selection.  
Selection Process:  
1. Weighted Scoring: The task requester specifies the number of nodes \(k\) and security level \(S\in\{0,1,2\}\) (corresponding to high, medium, or low security requirements). Validation nodes compute each node's weighted score: \[w_{i}=\alpha C_{i}+\beta P_{i}+\gamma R_{i}\] (3)where weights are \(\alpha=0.5\) (reputation), \(\beta=0.3\) (computational power), \(\gamma=0.2\) (completion rate), satisfying \(\alpha+\beta+\gamma=1\). Weights can be adjusted through participant negotiation.
2. Random Adjustment: To ensure new nodes (\(w_{i}=0\)) have a chance to participate, a Verifiable Random Function (VRF) adjusts scores: \[{w_{i}}^{\prime}=w_{i}+\text{VRF}(\text{seed},i)\cdot\delta,\delta\in[0,0.2]\] (4) where seed is collectively generated by validation nodes to ensure fairness, and \(\delta\) controls the random offset magnitude.
3. Grouping and Selection: Nodes are divided into four groups based on \(C_{i}\): \(H=\{i\mid C_{i}\geq 0.8\}\) (high reputation); \(M=\{i\mid 0.5\leq C_{i}<0.8\}\) (medium reputation); \(L=\{i\mid 0<C_{i}<0.5\}\) (low reputation); \(Z=\{i\mid C_{i}=0\}\) (new nodes). Proportions are set based on \(S\), e.g., for \(S=0\) (high security): \(r_{H}=0.7\), \(r_{M}=0.2\), \(r_{L}=0\), \(r_{Z}=0.1\). Calculate group sizes: \(n_{H}=\lfloor k\cdot r_{H}\rfloor,n_{M}=\lfloor k\cdot r_{M}\rfloor,n_{L}= \lfloor k\cdot r_{L}\rfloor,n_{Z}=\lfloor k\cdot r_{Z}\rfloor\). If the total is less than \(k\), increase \(n_{H}\). After verifying node availability, select nodes from each group in descending order of adjusted scores \(w_{i}\), ensuring the total number of nodes is \(k\).