Skip to main content
. 2022 Apr 27;11(9):1269. doi: 10.3390/foods11091269
Algorithm A2: Collect cross-chain smart contract B(CCSC-B)
Input: DATA; CCSC- A; N; skp
1:func Get-Crack (DATA, skp)// Obtain DATA and use user skp to decrypt to obtain Ds, etc.
{
For t in range (m)
If Preliminary decryption of DATA:
  Get user private key skp
  Decrypt DATA
  Return Dn, H(N), Ds and true
}
2: func Pre-stored(Ds)// Pre-storage based on data summary, get AD
{
For t in range (m)
If data pre-storage:
Data preprocessing based on data summaries
Return AD
Return false
}
3:func Get(N)// Obtain N through data interaction
{
For t in range (m)
If Get random number N:
Transfer(CCSC-A)
Return CCSC-AN; ADCCSC-A// N and AD exchange to obtain
If decrypt DATA:
  Decrypt with N to get D
  Get H(D) for D hash, verify whether D has been tampered with
}
4: func Storage(D)// Store according to the pre-stored address
{
For t in range (m)
If Data storage to parallel blockchain:
  Store D to the corresponding parallel blockchain
  Return Send Y/F to CCSC-A
}