The world is currently in a trend of low-carbon development, and clean energy is the core of low-carbon development and the key to solving climate problems. At present, the traceability methods for clean energy data, such as centralized databases, electronic labels, and energy certificates, have problems such as centralization, opaque data sources and processing, which cannot guarantee the credibility and security of data and traceability results. In contrast, blockchain has the characteristics of decentralization, transparency, and immutability, which can effectively solve the above problems. Therefore, this paper proposed a clean energy data traceability mechanism based on blockchain. Firstly, this paper proposed an improved Provenance Vocabulary model (ProVOC) to achieve trusted traceability of clean energy data throughout its lifecycle. By combining blockchain and graph databases, the lightweight storage of data was achieved and traceability efficiency was improved. Secondly, this paper proposed a data privacy protection mechanism based on zero-knowledge proof, introducing revocable mechanisms in user data privacy protection, and combining homomorphic encryption in traceability data privacy protection to achieve more secure data sharing. Finally, functional verification and performance analysis were conducted on the proposed data traceability mechanism. Compared to existing data traceability frameworks, the experimental results show that the mechanism proposed in this paper has certain advantages in terms of security and other aspects.