Research Article

A Research on Traceability Technology of Agricultural Products Supply Chain Based on Blockchain and IPFS

Algorithm 2

Goods registration algorithm.
Input: IDpro, Pro_Lot, Ptyp, Pquan, VIDpro, IDown, PKown,
Output: Registration result
(1)Goods owner upload IDpro, Pro_Lot, Ptyp, VIDpro, IDown onto the IPFS
(2)Goods owner sends Hpro, VIDpro, PKown to regulatory authorities
(3)Regulatory agencies verify the owner of the goods
(4)if the verification is successful then
(5) Regulatory agencies call node_record (IDpro, IDown, Pro_Lot, Time)//It can only be called by regulatory agencies to record the owner of the commodity batch at that time
(6)return “successful registration” then
(7) Goods owner invokes release_pro (IDpro, Pro_Lot, Ptyp, Pquan)//The goods are successfully registered by the owner, Later, the information of this batch of goods can be released for buyers to choose.
(8)else
(9)return “failed verification, please submit the information again”
(10)end if