We present a new protocol that allows two players to exchange digital signa
tures over the Internet in a fair way, so that either each player gets the
other's signature, or neither player does. The obvious application is where
the signatures represent items of value, for example, an electronic check
or airline ticket. The protocol can also be adapted to exchange encrypted d
ata. It relies on a trusted third party, but is "optimistic," in that the t
hird party is only needed in cases where one player crashes or attempts to
cheat, A key feature of our protocol is that a player can always force a ti
mely and fair termination, without the cooperation of the other player, eve
n in a completely asynchronous network. A specialization of our protocol ca
n be used for contract signing; this specialization is not only more effici
ent, but also has the important property that the third party can be held a
ccountable for its actions: if it ever cheats, this ran be detected and pro
ven.