The security of wireless sensor networks is ever more important nowadays. Most of the proposed security protocols in wireless sensor networks are based on authentication and encryption. But all of them only address part of the problem of security in wireless sensor networks. Recently, the use of reputation and trust systems has become an important secure mechanism in wireless sensor networks. In this paper we propose a new protocol ETSN to construct a trust framework model in wireless sensor networks. The ETSN will be more suitable than ATSN and RFSN in wireless sensor networks. The simulation results and analysis show that our scheme not only can fast detect the malicious nodes and scale well for wireless sensor networks, but also can distinguish trust rating with different event.