Abstract:Blockchain traceability is essential for ensuring food safety, improving the quality of agricultural products, and safeguarding consumer rights. Aiming at the security and protection needs of private data in the agricultural product supply chain, an attribute-based searchable encryption access control method for agricultural product blockchain traceability privacy data was proposed, which allowed the data owners of the traceability supply chain to encrypt access control policies in access control by using attribute-based searchable encryption technology. Traceability supply chain data requestors generated trap gates to match encryption policies to ensure the security of access control, effectively resisted the behavior of malicious nodes to forge information and illegally obtained permissions, hided user identities, avoided policy information leaks, and ensured the security of private data. Using ethereum proof of authority consensus mechanism to build a private chain for simulation experiments, the system test results showed that the generation time of searchable ciphertext was 2.5 ms, the generation time of trap gate was 39.8 ms, and the matching time of searchable ciphertext and trap gate was 8.6 ms. At the same time, the generation time of ciphertext did not increase linearly with the increase of number of attributes, and it had the characteristics of stability. The average time to upload searchable ciphertexts and traps to the blockchain was 2 033 ms, and the time to query for matches was 3.54 ms. Therefore, the access control method proposed can realize the hiding of access control policies, ensure the safe sharing of traceability privacy data, which was suitable for agricultural blockchain traceability.