## 4 The Proposed Scheme
### Privacy-Preserved Security Energy Trading
#### 4.2.4 Transaction
### Computation Overhead

The scheme suggested in this study makes use of the SM9 digital signature technique to create an anonymous identity for nodes and an anonymous identity signature private key for nodes, guaranteeing the confidentiality of the identities of both parties to the transaction. Based on the node's genuine identification, the KGC creates a special ID for it, and it stores the link between the pseudonym and the real identity of the node in the local list. The proposed scheme also leverages the Paillier additive homomorphic encryption algorithm to safeguard the nodes taking part in the transaction from unauthorized users reading sensitive data by encrypting the transaction amount. Additionally, the blockchain's distributed storage system and consensus algorithm guarantee the data's integrity, stop unauthorized users from secretly altering the data on the chain, and successfully fend off DDoS attacks. The SM9 digital signature algorithm and the Paillier encryption scheme's encryption and decryption of plaintext and ciphertext processes account for the majority of the computation overhead in the approach suggested in this work. Therefore, the simulation in this paper is mainly aimed at the running time of the SM9 digital signature algorithm and the Paillier encryption algorithm involved in the trading process. We use Java language and jPBC library to complete the simulation. The simulation environment is a Windows 10 system with AMD Ryzen 7 4800H CPU and 8.00 GB memory. In order to be closer to the IIoT environment, we use VMware Workstation 15 Pro to deploy virtual machines. The virtual machine environment is Ubuntu 20.04 with 2 GB of memory. Table 2 gives a description of the symbols. Table 3 displays the operating hours of each party in the suggested scheme. It is worth noting that the generation process of the system master key pair and the real identity key pair of each node is regarded as pre-calculation and is not discussed in the performance analysis. \begin{table}
\begin{tabular}{c c c c} \hline \hline \multirow{2}{*}{**Scheme**} & **Confidentiality of Transaction** & \multirow{2}{*}{**PCN**} & **Cloud** & **Anonymity of** \\  & **Amount** & & **Assistance** & **Nodes** \\ \hline
[1] & yes & no & no & yes \\
[8] & yes & no & no & yes \\
[10] & no & no & no & yes \\
[20] & no & no & yes & yes \\
[21] & no & no & no & yes \\
[22] & no & no & no & yes \\
[23] & yes & no & no & no \\ Proposed & yes & yes & yes & yes \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Scheme comparison. \begin{table}
\begin{tabular}{c c} \hline \hline \multicolumn{1}{c}{**Entity**} & \multicolumn{1}{c}{**Operation**} \\ \hline \(Sig()\) & represents signature operation \\ \(Ver()\) & represents signature verification operation \\ \(Enc()\) & represents encryption operation \\ \(Dec()\) & represents decryption operation \\ \(Mul()\) & represents ciphertext multiplication \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Symbol description. The computation overhead of the pseudonym mechanism based on IBS is shown in Table 4.

The key size is connected to the relevant procedures in the Paillier homomorphic encryption technique. Figure 7 and Table 5 shows the relationship between relevant operations and key size in the Paillier homomorphic encryption algorithm. As can be seen from Figure 7 and Table 5, when the key size is greater than 1024 bits, the computation overhead of \(Enc(a)\), \(Dec(Enc(a))\), and \(Dec(Enc(a)\times Enc(b))\) rises sharply. \begin{table}
\begin{tabular}{c c} \hline \hline
**Entity** & **Computation Overhead** \\ \hline Alice & 644.9301 ms \\ Bob & 659.9820 ms \\ KGC & 1501.5812 ms \\ TBN & 1475.2068 ms \\ CSP & 801.2629 ms \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Computation overhead of pseudonym mechanism based on IBS. \begin{table}
\begin{tabular}{c c} \hline \hline
**Entity** & **Operation** \\ \hline Alice & \(Sig()\) + 4\(Enc()\) \\ Bob & \(Sig()\) + 2\(Enc()\) \\ KGC & \(2 Ver()\) + 3\(Mul()\) \\ TBN & \(2 Sig()\) \\ CSP & \(Ver()\) \\ \hline \hline \end{tabular}
\end{table}