# Enable Fair Proof-of-Work (PoW) Consensus for Blockchains in IoT by Miner Twins (MinT)
## 4 Miner Twin-Enabled Fair-Mining Mechanism
### Fast Anomaly Detection for Fair Mining  
Fast and accurate identification of the misbehaved miners is an essential step to ensuring fair mining, where MinT adopts the Singular Spectrum Analysis (SSA) algorithm to achieve this goal. SSA is recognized as one of the quickest sequential change-point detection approaches for processing time series problems [39]. By decomposing and reconstructing the interested time series, SSA extracts certain components of the origin series such as periodic pattern, noises, trends, etc. SSA is widely used in solving problems such as smoothing, extraction of seasonality components, as well as study the structure in some minor time series and change-point detection [36]. Unlike traditional methods, SSA is non-parametric and does not require prior knowledge of the parametric model of the considered time series data. Although SSA uses some statistical concepts, it does not need any statistical assumptions about the target series. Moreover, SSA algorithm can be used for processing time series with relatively small size, which make this method more suitable for edge-fog scenarios [40]. The SSA algorithm can be divided into four steps as (see [PERSON] et al. at 2003) [41]:  
**1. Embedding:** The target of SSA is a one-dimensional time series \(\mathbb{X}=[x_{1},\ldots,x_{N}]\), where \(N\) is the series length. By choosing proper window length \(L\), one can transfer the times series into multi-dimensional series of vectors \(\vec{X}_{i}\). Combine these vectors results in the trajectory matrix \(X=[\vec{X}_{1},\vec{X}_{2},\ldots,\vec{X}_{K}]\), where \(K=N-L+1\). The multi-dimensional vectors \(\vec{X}_{i}=(x_{i},\ldots,x_{L+i-1})^{\prime},i=1,\ldots,K\), are also called lagged vectors. **2. Singular Value Decomposition (SVD) [42]:** After singular value decomposing the trajectory matrix \(X\), the eigenvalues are denoted by \(\lambda_{1},\ldots,\lambda_{L}\) in decreasing order \begin{table}
\begin{tabular}{c l l l} \hline \hline
**Symbol** & **Descriptions** & **Symbol** & **Descriptions** \\ \hline \(PO_{ki}\) & parameter vector of miner & \(LO_{ki}\) & parameter vector of twin \\ \hline \(c_{ki}\) & cpu usage & \(g_{ki}\) & gpu usage \\ \hline \(m_{ki}\) & memory usage & \(b_{ki}\) & I/O bandwidth \\ \hline \(\mathbb{X}\) & target time series & \(X\) & trajectory matrix \\ \hline \(N\) & target series length & \(L\) & SSA window length \\ \hline \(\vec{X}_{i}\) & lagged vectors & \(K\) & numbers of lagged vectors \\ \hline \(\lambda_{L}\) & eigenvalues & \(U\) & left singular matrix \\ \hline \(V\) & right singular matrix & \(l\) & subset indices \\ \hline \(X_{l}\) & reconstructed matrix & \(\mathbb{X}_{1}\) & reconstructed time series \\ \hline \(X_{t}est\) & test matrix & \(\vec{X}_{j}\) & vectors of test matrix \\ \hline \(p\) & starting point of test matrix & \(q\) & ending point of test matrix \\ \hline \(Q\) & window length of test matrix & \(D_{n,l,p,q}\) & sum of the squared distances \\ \hline \(S_{n}\) & normalized sum & \(W_{n}\) & CUSUM of squared distances \\ \hline \(\mu_{n,l}\) & estimator & \(\kappa\) & constant of \(W_{n}\) \\ \hline \(h\) & threshold for \(W_{n}\) & \(t_{a}\) & quantile of the standard normal distribution \\ \hline \(\mathcal{N}\) & mining network & \(n_{i}\) & miners \\ \hline \(m_{i}\) & dishonest miners & \(f\) & fraction of dishonest \\ \hline \(B_{i}\) & behavior vector & \(G\) & global view of \(B_{i}\) \\ \hline \(B^{*}\) & benchmark of \(B_{i}\) & \(s(i)\) & consensus score \\ \hline \(s^{*}\) & ground truth of \(s(i)\) & \(d\) & POB window length \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Relevant basic notations. of magnitude and the corresponding eigenvectors \(U_{1},\ldots,U_{L}\) where the matrix \(U=[U_{1},U_{2},\ldots,U_{L}]\) and \(\|\mathbf{U_{i}}\|=1\) is orthogonal. Then, the eigentriples are \((\sqrt{\lambda_{i}},U_{i},V_{i})\), by denoting \(V_{i}=X^{\prime}U_{i}/\sqrt{\lambda_{i}}\). Supposing that the rank of \(X\) is \(d\), then the trajectory matrix is \(X=X_{1}+\ldots+X_{d}\). **3.