With the development and application of blockchain technology, the privacy leakage problem brought by blockchain technology has become increasingly serious while providing immutability and transparency. Although ring signature has been widely used in blockchain privacy protection schemes, existing schemes are based on public key infrastructure system with high certificate management costs. In addition, with the increasing demand for domestic application of blockchain systems, existing national commercial cryptographic algorithms can no longer meet the increasingly complex application requirements of blockchain. To solve these problems, we propose a constant-size ring signature scheme based on SM9 digital signature algorithm and prove its security under the random oracle model. In addition, based on this ring signature algorithm, we modify the consortium blockchain, Hyperledger Fabric, to achieve transaction sender identity privacy protection. We utilize the Miracl library to test the computation time and analyze the computational and communication costs of our approach. The experimental analysis results demonstrate that compared with existing solutions, our approach achieves several times efficiency improvement in signature generation and verification. When the number of ring members exceeds 20, our approach exhibits significant advantages in terms of signature communication costs.