## 4 Anonymity, Untraceability and Transactional Data Privacy (AUT) Protocol
As depicted from line 1 to 13 of Algorithm 1, \(ProGW_{j}\) sends a transaction (\(T_{Broadcast}\)) to broadcast its bids anonymously in the auction board as in Equation (1), which also includes \(ProGW_{j}\)'s public ID \((MSID_{ProGW_{ph}})\), the block timestamp and the nonce:  
\[T_{Broadcast}=MSID_{ProGW_{ph}}\parallel Type\parallel Volume\parallel \tag{1}\] \[\qquad Price\parallel T\text{\small timestamp }\parallel None \parallel Unit\]  
In the second stage of Figure 2 and from line 14 to 18 in Algorithm 1, \(ReqGW_{i}\) selects \(ProGW_{j}\)'s ID as the potential supplier and then encrypts a negotiation message using the chosen public ID of the potential \(ProGW_{j}\) before broadcasting it anonymously in the blockchain network. This is achieved by encrypting the message with \(ProGW_{j}\)'s ID (\(MSID_{ProGW_{ph}}\)) as follows:  
\[MSID_{ProGW_{ph}}(MSID_{ReqGW_{ph}},\omega_{i},T_{i})=\phi_{i} \tag{2}\]  
Figure 2: Proposed Anonymity and transactional data privacy protection protocol operation flow. where \(\omega_{i}\) is the request message, \(T_{i}\) is the block timestamp and \(MSID_{ReqGW_{pub}}\) is \(ReqGW_{i}\)'s public ID. \(ReqGW_{i}\)'s identity remains anonymous behind a pseudonym \(MSID_{ReqGW_{pub}}\). However, its important to note that each time a message is broadcasted in the system, a validating authority (node) validates the message and adds it to the blockchain based on the proof-of-authority (PoA) consensus algorithm. With this, the encrypted message is published in the blockchain network, where all participant nodes will receive a copy of the package. In the third stage of Figure 2 and line 20 in Algorithm 1, only \(ProGW_{j}\), which has the right private ID, will be able to decrypt the message:  
\[MSID_{ProGwp_{Pro}}(\phi_{i})=\omega_{i},T_{i},MSID_{ReqGW_{pub}} \tag{3}\]  
```
Input: Read the value: \(MSID_{pubProGwp_{pub}}\gets hash(Public\_Key_{ProGW})\)\(MSID_{pubProGwp_{Pro}}\gets hash(Private\_Key_{ProGW})\)\(MSID_{pub_{ReqGW_{pub}}}\gets hash(Public\_Key_{ReqGW})\)\(MSID_{pub_{ReqGW_{Pro}}}\gets hash(Private\_Key_{ReqGW})\)Output:\(Payment_{Broadcast}\):\(Release_{Broadcast}\)
1 Function\(T_{Broadcast}\)(T(B)):
2\(\mathcal{P}\leftarrow\) Participant
3 if(\(\mathcal{P}=ProGW\))then
4\(Type\leftarrow\) Type of resource; \(Volume\leftarrow\) Amount of resource; \(Price\leftarrow\) Price of resource; \(Unit\leftarrow\) Unit of resource;  Compute resource tender \(T(R)\); \(T(R)\leftarrow(Type,Volume,Price,Unit)\); \(T_{Broadcast}\leftarrow\{MSID_{ProGW_{pub}},T(R),Timestamp\}\)
5 else
6\(T_{Broadcast}\gets MSID_{ReqGW_{pub}}\)
7 end if
8 FunctionNegotiation(NG):
9 Compute negotiation message \(\omega_{i}\); \(\phi_{i}\leftarrow\) Encrypt \(\{MSID_{ReqGW_{pub}},\omega_{i},T_{i}\}\); \(NG_{Broadcast}\leftarrow\phi_{i}\)
10 Function Acknowledgement(ACK):
11 Decrypt \(\phi_{i}\);
12 Compute acknowledgement message \(\omega_{j}\); \(\phi_{j}\leftarrow\) Encrypt \(\{MSID_{ProGwp_{pub}},\omega_{j},T_{j}\}\); \(ACK_{Broadcast}\leftarrow\phi_{j}\)
13 FunctionPayment_Details(PAY):
14 Decrypt \(\phi_{j}\);
15 Compute Payment message \(\omega_{k}\); \(\phi_{k}\leftarrow\) Encrypt \(\{MSID_{ReqGW_{pub}},\omega_{k},T_{k}\}\); \(Payment_{Broadcast}\leftarrow\phi_{k}\)
16 FunctionResource_Release(RR):
17 Decrypt \(\phi_{k}\);
18 Resource Released! 19 Compute Release message \(\omega_{z}\); \(\phi_{z}\leftarrow\) Encrypt \(\{MSID_{ProGwp_{pub}},\omega_{z},T_{z}\}\); \(Release_{Broadcast}\leftarrow\phi_{z}\)
```  
**Algorithm 1**Proposed anonymity and transactional data privacy protection protocol. In the fourth through sixth stage of Figure 2 and from line 21 to 37 of Algorithm 1, acknowledgement reply and payment messages are encrypted and decrypted accordingly to ensure speedy transmission of transactional messages in a secure and private manner at both sides of \(\mathit{ProGW}_{j}\) and \(\mathit{ReqGW}_{i}\) with a relatively low overhead until the trading activities are concluded.