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

Table 3: Main operations of the proposed scheme. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Operation** & **128 bits** & **256 bits** & **512 bits** & **1024 bits** & **2048 bis** \\ \hline \(Enc(a)\) & 0.4764 ms & 2.8156 ms & 4.5277 ms & 18.2366 ms & 106.5709 ms \\ \(Dec(Enc(a))\) & 4.8908 ms & 13.313 ms & 17.7056 ms & 79.6857 ms & 246.5112 ms \\ \(Enc(a)\times Enc(b)\) & 0.0319 ms & 0.0409 ms & 0.0412 ms & 0.1439 ms & 0.2872 ms \\ \(Dec(Enc(a)\times Enc(b))\) & 1.0243 ms & 3.7358 ms & 11.9766 ms & 60.4985 ms & 210.4611 ms \\ \hline \hline \end{tabular}
\end{table} 
Table 5: The effect of key size on the computation overhead of Paillier homomorphic encryption algorithm. Figure 7: The effect of key size on the computation overhead of Paillier homomorphic encryption algorithm. \(Enc(a)\times Enc(b)\) is hardly affected by the key size. In the proposed scheme, the _keysize_ = 512 bit is selected. The total computation overhead of each part is shown in Figure 8. Figure 9 displays the comparison between the overall computation overhead of the approach suggested in this research and that of [8]. Figure 9 illustrates the advantages of the scheme described in this paper in terms of computing overhead. ### Communication Overhead and Storage Overhead

At the stage of applying for a pseudonym, [PERSON] and [PERSON] send the pseudonym request information and signature to KGC: \(|PA_{[PERSON]}|+|Sig_{[PERSON]}(PA_{[PERSON]})|=0.195\) KB, \(|PA_{[PERSON]}|+|Sig_{[PERSON]}(PA_{[PERSON]})|=0.195\) KB. KGC returns the pseudonym to [PERSON] and [PERSON]: \(|Pid_{[PERSON]}|+|Pid_{[PERSON]}|=0.125\) KB. In the transaction stage, [PERSON] conducted four homomorphic encrypted information transmissions: \(|M_{1}|+|M_{3}|+|M_{4}|+|M_{5}|=1.199\) KB. Meanwhile, [PERSON] conducted two homomorphic encrypted transmissions: \(|M_{2}|+|M_{6}|=0.599\) KB. Then, KGC calculated the ciphertext product three times: \(|Enc(\hat{\rho}_{0}^{[PERSON]})x\times Enc(\hat{\rho}_{0}^{[PERSON]})|+|

Figure 8: Computation overhead of each entity. Figure 9: Computation overhead comparison with CS2V [8]. \(|Enc(\alpha)\times Enc(\beta_{A})|+|Enc(\beta_{A}+\zeta)\times Enc(\beta_{B})|=0.902\) KB. At the transaction completion stage, TBN uploads and broadcasts \(Data_{CSP}\) and \(Data_{block}\): \(|Data_{CSP}|+|Data_{block}|=1.037\) KB. It should be noted that the number of times the HTLC contract is sent depends on the number of nodes in the payment channel, so it is not discussed here. The communication overhead of each entity is shown in Table 6.

We evaluated the storage overhead of the on-chain storage and the off-chain storage to assess the impact of the off-chain storage technique suggested in this paper. Figure 10 depicts the outcomes of our comparison between the storage overhead in [8] and that in this system. Figure 10 shows that the strategy suggested in this research has benefits in terms of storage overhead. ## 6 Discussion

The scheme presented in this study introduces the SM9 digital signature algorithm and Paillier homomorphic encryption algorithm in order to effectively protect the nodes' privacy and information security in energy trading. Additionally, cloud-assisted PCN-based off-chain transactions offer a more effective and practical method for transactions. The scheme is feasible, according to the simulation findings. The method outlined in this paper has some limitations. The computation overhead will rise as a result of the frequent data interchange between KGC and nodes, as explained in Section 3. However, the transaction cost is lowered as a result of the off-chain transaction method, which is acceptable. Future studies must find ways to lessen KGC's computational requirements as much as possible. In addition, the security and performance of the SM9 algorithm have been proven in [28], so this article does not repeat it. Finally, the scheme outlined in this study has the potential to theoretically address the security issue associated with blockchain-based energy trading.