# A Privacy-Preserving Record Linkage Method Based on Secret Sharing and Blockchain
## 4 Methods
### Output and Audit Module
#### 4.4.4 Record Keeping and Provenance  
To ensure traceability and transparency in the audit process, the blockchain records all critical data and computing node actions, including CIDs of Boolean shares \(s_{A,J,k}\), \(s_{B,J,k}\), masks \(r_{l,g}\) and \(a_{l,g,k}\) from the data preparation module, and \(s_{k}\) from the approximate matching phase, managed by the data distribution smart contract to maintain clear mappings between matching pairs and masks. Audit verification contract uses on-chain index tables and IPFS data to conduct periodic or on-demand audits, verifying task assignment consistency and ensuring recomputed shares match uploaded ones. Immutable audit logs on the blockchain capture node reputation changes, anomalies, and verification outcomes, providing a reliable foundation for long-term system operation. If participants question the results, they can request an audit via the verification contract, obtaining a report to confirm result validity. The process operates autonomously, with blockchain and IPFS collaboration ensuring efficient and fair audits. The algorithm for masked difference conversion and Hamming distance calculation is described in pseudocode as shown in Algorithm 4. ```
1:task_id: Task identifier; sample_rate: Proportion of results to audit; index_table: Index table with CIDs; node_performance: Node historical performance data
2:Output: audit_results: Audit results with verification outcomes; updated_reputation: Updated reputation scores; blockchain_records: Stored records on blockchain
3:sampled_shares \(\leftarrow\) RandomSample(partial_hamming_shares, sample_rate)
4:for each share in sampled_shares do
5: task_data \(\leftarrow\) GetTaskData(index_table, share)
6: reference_share \(\leftarrow\) RecomputeShare(task_data)
7:if reference_share == share then
8: audit_results[share] \(\leftarrow\) \"Verified\"
9: UpdateNodeReputation(node, outcome = \"Success\")
10:else
11: audit_results[share] \(\leftarrow\) \"Failed\"
12: UpdateNodeReputation(node, outcome = \"Failure\")
13:endif
14:endfor
15: cid_audit, cid_reputation \(\leftarrow\) UploadResultsToIPFS(audit_results, up_reputation)
16: cid_reputation \(\leftarrow\) UploadToIPFS(updated_reputation)
17: return audit_results, up_reputation, StoreToBlockchain(cid_audit, cid_reputation)In Algorithm 4, lines 1-4: Randomly sample a portion of the computation result shares and prepare for verification by recalculating. Lines 5-11: Compare the recalculated results with the submitted results, record the audit outcome (\"Verified\" or \"Failed\") accordingly, and update the reputation values of the corresponding computation nodes. Lines 12-15: After the loop, upload the final audit results and updated reputation data to IPFS, store the address (CID) on the blockchain, and return the audit results and reputation data. ## 5 Method Analysis

### Complexity Analysis

The computational and communication complexity analysis of this method is as follows. Assume there are \(P\) participants, each participant \(p_{i}\) possesses \(N_{i}\) records, and let \(N\ =\ \max(N_{i})\). The Bloom filter length is \(m\), using \(k\) hash functions, with quasi-identifier attributes generating an average of \(Q\) q-grams. The secret sharing threshold is \(t\), meaning each Bloom filter bit is split into \(t\) shares processed by \(t\) computing nodes. The system selects \(N_{\text{nodes}}\) computing nodes to form a node pool. The total number of record pairs to be matched is \(M\), distributed across \(K\) mask groups, with an audit sampling rate of \(s\). In the data preparation and generation module, parameter negotiation among participants involves on-chain computation and communication costs, with complexity depending on the consensus mechanism and the number of participants \(P\), denoted as \(O\big{(}\text{BC}_{\text{negotiate}}(P)\big{)}\)[32]. Data encoding is a local operation, with computational complexity for each participant \(p_{i}\) as \(O(N_{i}\cdot Q\cdot k)\), and the total across all participants is \(\sum O(N_{i}\cdot Q\cdot k)\).