In wireless sensor network (WSN), sensor nodes are deployed in the corresponding application fields, in order to observe their environment and send their observations to the Sink. The message source should be protected in the process of transmission between nodes and Sink. On one hand, message authentication is one of the most effective ways to keep unauthorized and corrupted messages from being forwarded in wireless sensor network; on the other hand, anonymous communication can hide sensitive nodes identity information to implement the privacy protection of nodes location. However, anonymous communication has incurred a series of problems, such as, it gives the attacker an opportunity to use anonymous technology for illegal activities. Thus, it is particularly important to track the identity of the malicious nodes. In order to solve the problems above, a traceable and anonymous authentication scheme based on elliptic curve is proposed in this paper. The scheme combines elliptic curve with ring signature, implements nodes anonymous communication and provides the intermediate nodes authentication. The simulation results demonstrate that this scheme is equal to the existing schemes on the signature and certification cost. While, by using the linkable characteristics of ring signature, the proposed scheme can realize the traceability of malicious nodes, and improve the performance and security of the network.