Abstract:With the development of blockchain technology in the field of food traceability, the quality and safety of prepared foods have been effectively guaranteed. However, the numerous industrial characteristics of the upstream and downstream production and processing links of prepared foods made traceability difficult. How to safely share recipes, secret recipes and other private data while tracing the source is very important to enable better collaborative production in the supply chain. In order to solve the above problems, a threshold proxy re-encryption privacy data sharing method for prepared food traceability was proposed, and prepared food traceability chain blocks were designed and the production batch number associated related traceability data was traced. Using the threshold proxy re-encryption, the prepared food manufacturer re-encrypted the recipes developed through the threshold proxy to encrypt the recipe to generate the initial encryption ciphertext. At the same time, the re-encryption key was generated locally, and the initial encryption ciphertext and the re-encryption key were generated locally and uploaded to the prepared food traceability blockchain; third-party semi-honest service providers would re-encrypt the re-encrypted materials obtained from the blockchain and upload the re-encrypted ciphertext to the blockchain; data visitors such as regulatory authorities used the own private key would re-encrypt and decrypt the re-encrypted ciphertext obtained from the blockchain to achieve safe sharing of private data on the traceable blockchain. This method was based on Hyperledger Fabric, and a blockchain prototype system for full-process traceability of the supply chain of prepared foods was constructed for testing. Test results showed that the threshold proxy re-encryption method proposed showed lower computational overhead compared with commonly used data encryption sharing methods in secure sharing of private data in prepared food traceability. The average delays of data uploading, public data query and private data query were 1473.8ms, 63.9ms and 59.9ms, respectively. The system performance was good. Experiments showed that the proposed method achieved the purpose of secure sharing of supply chain privacy data, ensured the safe sharing of business secrets and intellectual property rights, which was of great value to the development of the prepared food industry and the improvement of food safety.