# Secure Data Sharing in Federated Learning through Blockchain-Based Aggregation
## 4 The Enhanced Scheme
Creates shares of its proof \(\mathbf{\pi}_{i}\) for other clients: \(\{(\{\mathbf{h}_{i}\}_{i}],\cdots(\{\mathbf{h}_{i}\}_{i},\mathbf{h}_{i}),\mathbf{\Psi}_{\mathbf{ \pi}_{i}}\}\gets SS\_share(\mathbf{h}_{i},[\mathbf{u}]\setminus\{i,\mathbf{n}+1\},\{(\{ \mathbf{a}_{i}\}_{i}\)}\cdots(\{\mathbf{a}_{i},\mathbf{a}_{i}\}_{i}),\mathbf{\Psi}_{\mathbf{\pi}_{i }}\}\gets SS\_share(\mathbf{a}_{i},[\mathbf{u}]\setminus\{i,\mathbf{m}+1\},\{(\{\mathbf{h}_{i }\}_{i}\)}\cdots(\{\mathbf{a}_{i},\mathbf{b}_{i}\}_{i})\gets SS\_share(\mathbf{b}_{i},[\mathbf{u}] \setminus\{i,\mathbf{m}+1\},\{(\{\mathbf{h}_{i}\}_{i}\)}\cdots(\{\mathbf{h}_{i},\mathbf{b}_{i }\}_{i})\gets SS\_share(\mathbf{b}_{i},[\mathbf{u}]\setminus\{i,\mathbf{m}+1\},\{(\{\mathbf{h }_{i}\}_{i}\)}\cdots(\{\mathbf{h}_{i},\mathbf{c}_{i}\}_{i})\gets SS\_share(\mathbf{c}_{i},[ \mathbf{u}]\setminus\{i,\mathbf{m}+1\},\{\mathbf{h}_{i}\}_{i})\). 4. Publishes the encrypted proof strings \(\forall\mathcal{C}_{i}\in\mathcal{C}_{i}\langle\overline{\mathbf{i}_{\mathbf{x}_{i}}} \overline{\mathbf{i}_{\mathbf{x}_{i}}}\rangle||(\mathbf{i},\mathbf{\pi}_{i})\gets SE\_ {\mathcal{C}_{i}\langle\overline{\mathbf{i}_{\mathbf{x}_{i}}}\rangle||(\mathbf{i},\mathbf{\pi} _{i})|}\rangle\), \(\mathbf{\pi}_{i,i}=\mathbf{h}_{i}||\mathbf{a}_{i}||\mathbf{b}_{i}||\mathbf{c}_{i}|\) with its check strings \((\mathbf{\Psi}_{\mathbf{\pi}_{i}},\mathbf{\Psi}_{\mathbf{\pi}_{i}})\) on the **blockchain**. 2. The protected parameters are verified as follows: 1. Verifies validity of secret shares: Each client \(\mathcal{C}_{i}^{*}\): 1. Retrieves and decrypts the shares pertaining to it: \((i,\mathbf{\pi}_{ij})||(i,\mathbf{\pi}_{ij})\gets SE\_dec_{\mathcal{C}_{i}^{*}} \langle\overline{(\mathbf{i},\mathbf{\pi}_{ij})}\rangle||\) 2. Verifies the shares \(\mathbf{\pi}_{ij}(\mathbf{\pi}_{ij})\) using the check string \(\mathbf{\Psi}_{\mathbf{\pi}_{i}}(\mathbf{\Psi}_{\mathbf{\pi}_{i}})\). 2. If any share fails to be decrypted or verified, flag its reactor on the **blockchain**. 2. **Blockchain (via smart contract): 1. Upon receiving a report (e.g., \(\mathcal{C}_{i}\) flags \(\mathcal{C}_{i}\)), updates \(Flag[\hat{\mathbf{j}}]=Flag[\hat{\mathbf{j}}]\cup\mathcal{C}_{i}\). 2. Updates \(\mathcal{C}^{*}\) as follows: 1. If \(|Flag[\hat{\mathbf{j}}]|>m\), \(\mathcal{C}_{i}\) is marked as malicious: \(\mathcal{C}^{*}=\mathcal{C}^{*}\cup\mathcal{C}_{i}\). 2. If any client, \(\mathcal{C}_{i}\) is reported as more than \(m\) clients, it is considered malicious: \(\mathcal{C}^{*}=\mathcal{C}^{*}\cup\mathcal{C}_{i}\). 3. For every client \(\mathcal{C}_{i}\) that has been reported, but \(|Flag[\hat{\mathbf{j}}]|\leq m\), suppose that \(\mathcal{C}_{i}\) has flagged \(\mathcal{C}_{i}\) per the following steps: 1. Asks \(\mathcal{C}_{i}\) and \(\mathcal{C}_{i}\) to publish \(\mathcal{K}_{i}\) and \(\mathcal{K}_{i}\) in the **blockchain**. 2. Compases these keys to the hash values from the setup phase; if some of them do not match, then flag the owner and update \(\mathcal{C}^{*}\). Note that these keys should be equal and their hash values should be equal to that stored in the setup phase. 3. Uses \(\mathcal{K}_{i}\) to decrypt the encrypted share from \(\mathcal{C}_{i}\) to \(\mathcal{C}_{i}\), and verifies the result. If everything passes, update \(\mathcal{C}^{*}=\mathcal{C}^{*}\cup\mathcal{C}_{i}\); otherwise, update \(\mathcal{C}^{*}=\mathcal{C}^{*}\cup\mathcal{C}_{i}\). 4. Generation of proof summaries: 2. Hash the current data on **the blockchain** to generate a random number \(r\in\mathbb{F}\). Each client \(\mathcal{C}_{i}\): * Generates a summary \(\sigma_{ij}\) of the proof string \(\mathbf{\pi}_{ij}\) based on \(r\) and SNIP; \(\forall\mathcal{C}_{i}\
otin\mathcal{C}^{*}\), and publishes it on the **blockchain**. 3. Verification of proof summaries: 3. **Blockchain** (via smart contract): 4. Collects and verifies all proof summaries from \(\mathcal{C}\setminus\mathcal{C}^{*}\) with \(robustRecon(\cdot)\), and updates \(\mathcal{C}^{*}\) based on the result. 4. Each client \(\mathcal{C}_{i}\): 1.