Skip to main content
. 2022 Oct 15;22(20):7842. doi: 10.3390/s22207842
Algorithm 3: Verification algorithm of data trading information traceability process
Input: SupPeer, Keysupcha, Keyoriinfo, TradingName
   Output: Veriresult
1 // Query the original data trading information and its corresponding block number from the off-chain database
2 OriTradingInfo=queryTradingInfo(SupPeer, Keyoriinfo, TradingName);
3 // Compute the hash value of the original data trading information
4 H1=calcHash(OriTradingInfo);
5 // Query the hash value in the blockchain based on the block number
6 H2=queryTradingInfo(SupPeer, Keysupchan, OriTradingInfo[7]);
7 If (H1==H2)
8   return Veripass;
9 else
10   return Verifail;