A fair exchange protocol allows two entities to exchange digital signatures over open networks in a fair way, so that either each entity obtains the other's signature or neither entity does. Fair exchange protocol plays an important role in electronic commerce in the case of exchanging digital contracts. In this paper, we propose a fair exchange protocol based on identity-based verifiably encrypted signatures. Our protocol involves an offline trusted third party which is only required when one entity attempts to cheat or crashes. The underlining identity-based verifiably encrypted signature scheme is proven secure under the computational Diffie–Hellman assumption and is the first identity-based verifiably encrypted signature scheme provably secure against existential unforgeable under adaptive chosen message and identity attacks in the standard model. Copyright © 2012 John Wiley & Sons, Ltd.