Smart grid develops rapidly, but there are still security risks such as user privacy leakage, power data tampering and audit data inconsistency. The existing schemes to ensure data security mainly use traceable ring signcryption, which is applied in distributed application scenarios such as smart grid. Traceable ring signcryption can ensure the anonymity, integrity, unforgeability and confidentiality of data, and can trace the real identity of anonymous users. However, the traceability of these schemes is arbitrary, any actor can trace the identity of anonymous users, and they do not resolve disputes caused by tampered or inconsistent data. To remedy these deficiencies, we combine ring signcryption with consortium blockchain technology for the first time to achieve privacy protection and conditional tracing, which can effectively avoid anonymous user identity being revealed at will. Consortium blockchain is a semi-distributed P2P network that can solve data disputes and is suitable for organizations that require certain access control mechanisms such as smart grid. In this paper, we propose a heterogeneous ring signcryption scheme with privacy protection and conditional tracing (CTHRSC) which between certificateless cryptographic system (CLC) and public key infrastructure (PKI). Besides, we prove that our scheme is secure under the discrete logarithm problem (DLP) and decisional Diffie–Hellman problem (DDHP) in random oracle model (ROM). Compared with other signature or signcryption schemes, our advantages are satisfying conditional tracing and known temporary session key security (KTSKS), requiring less computation cost and communication overhead.