|
Algorithm 4 Algorithm for store traceability data. |
Require: traceability data: TD, fixed time: T
-
1:
TD was generated on the participation node.
-
2:
Diffp(TD) ← Differential privacy processing of TD.
-
3:
[Diffp(TD), hash(TD)] ← Hash TD to form private-chain TD data.
-
4:
Sign(TD); [Sign(Diffp(TD)), hash(TD)] ← User signature.
-
5:
Tx = [Txhash, BH, SN, FROM, TO, NSign, TS, Sign(Diffp(TD)), hash(TD)] ← Generate transaction.
-
6:
while Every T time do
-
7:
send(Tx) to MNode ← PNode Send Tx to its MNode to which it belongs.
-
8:
send(TD) to MNode ← PNode Send TD to its MNode to which it belongs.
-
9:
if hash(TD) = Tx.hash(TD) then
-
10:
Put Tx into txpool; Put TD into tdpool ← Put Tx and TD into the buffer pool and wait for block generation.
-
11:
else
-
12:
.
-
13:
end if
-
14:
end while
|