# RingFFL: A Ring-Architecture-Based Fair Federated Learning Framework
## 4. Penalty Mechanism in RingFFL
#### 3.2.5 _Roof deposits_  
We introduce the roof deposits phase in two cases: normal and abnormal situations. The normal situation is the case that all clients perform honestly as required, and the abnormal situation is the case that there are clients who do not perform the corresponding process as required during the training. The situations are presented in detail below. 1. Normal situation. 2. Each client \(P_{i}(i=1,\cdots,N-1)\) simultaneously deposits \(coins(b)\) to \(P_{N}\) under the condition \(C_{N}\), and the deadline is \(t_{N}\). The detail is that each \(P_{i}(i=1,2,\cdots,N-1)\) broadcasts \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Description** \\ \hline \(p_{i}\) & The \(i\)-th client \\ \(N\) & The number of all clients \\ \(T_{i}\) & Client \(i\)’s private data set \\ \(M_{i}\) & Client \(i\)’s local model parameters \\ \(C\) & Conditions for obtaining digital currencies \\ \(E\) & Evidence needed to obtain digital currencies \\ \(M^{int}\) & Initial model of FL \\ \(MAX\) & Maximum communication rounds of FL \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Summary of main notations. a transaction \(\left(deposit,T_{id},T^{{}^{\prime}}_{id},P_{i},P_{N},C_{N},t_{N},b\right)\) to the network, in which \(T_{id}\) is the session identifier and \(T^{{}^{\prime}}_{id}\) is the transaction identifier. Ignore other transactions with the same \(T^{{}^{\prime}}_{id}\) sent by \(P_{i}(i=1,2,\cdots,N-1)\) to \(P_{N}\) before the end of RingFFL. The process is denoted as \[Ack_{i,N}:\quad P_{i}\xrightarrow[b\,t_{N}]{C_{N}}P_{N}\] (2). Abnormal situation. If the transaction \(\left(deposit,T_{id},T^{{}^{\prime}}_{id},P_{i},P_{N},C_{N},t_{N},b\right)\) is not recorded on the blockchain for any one of \(P_{i}(i=1,\cdots,N-1)\), all \(P_{i}(i=1,\cdots,N-1)\) wait until time \(t_{N+1}\) to receive \(Ack_{i,N}\)'s reimbursement message \(\left(reimburse,T_{id},T^{{}^{\prime}}_{id},P_{i},P_{N},C_{N},t_{N}, coins(b)\right)\) to \(P_{i}\)'s wallet, and the RingFFL stops, in which \(i=1,\cdots,N-1\). _Ladder deposits_  
Like roof deposits, we introduce the ladder deposits phase in two cases: normal and abnormal situations. (a) Normal situation. After the clients, except \(P_{N}\), complete the roof deposits, all clients perform the process of ladder deposits in turn. First, \(P_{N}\) broadcasts a transaction \(\left(deposit,T_{id},T^{{}^{\prime}}_{id},P_{N},P_{N-1},C_{N-1},\right.\)\(t_{N-1},\)\((N-1)b\right)\) to the network as a deposit to \(P_{N-1}\) under condition \(C_{N-1}\) with deadline \(t_{N-1}\). Similarly, \(P_{N-1}\) deposits \(coins((N-2)b)\) to \(P_{N-2}\) under condition \(C_{N-2}\). It continues until \(P_{2}\) deposits \(coins(b)\) to \(P_{1}\) under condition \(C_{1}\). For \(i=N-1\) down to \(i=1\), the process is denoted as \[Ack_{i+1,i}:\quad P_{i+1}\xrightarrow[i\,b\,t_{i}]{C_{i}}P_{i}\] (3). Abnormal situation. If there is no transaction within the network that client \(P_{i+1}\) sends deposits to \(P_{i}\)\((i=1,\cdots,N-1)\) as described above, all \(P_{j}(j\leq i)\) do not perform the ladder deposits and wait for \(Ack_{i,N}\)'s reimbursement according to Equation (2). All \(P_{j}(j>i)\) need to wait until the end of the RingFFL to judge whether their ladder deposits are acknowledged. _Acknowledgment_  
Like roof deposits, we introduce the acknowledgment phase in two cases: normal and abnormal situations. (a) Normal situation. In the acknowledgment phase, we define \(E_{i+1}\) and \(C_{i}\) as follows:  
\[E_{i+1}\xrightarrow[]{\Delta}Expand(i+1,E_{i};M_{i+1})=E_{i}\|M_{i+1} \tag{4}\]  
\[C_{i}\left(M^{{}^{\prime}}_{1}\middle\|\cdots\middle\|M^{{}^{\prime}}_{i};\{H_ {1},H_{2},\cdots,H_{l}\}\right)=\left[Hash\left(M^{{}^{\prime}}_{1}\right) \xrightarrow[]{\Delta}H_{1}\right]\cap\cdots\cap\left[Hash\left(M^{{}^{ \prime}}_{i}\right)\xrightarrow[]{\Delta}H_{i}\right] \tag{5}\]  
in which \(H_{i}\) is associated with Equation (1), \(M^{{}^{\prime}}_{i}\) is the model parameters received from neighboring client, and \(A\|B\) denotes a connection between \(A\) and \(B\).