Escrows are optics
Fabrizio Genovese, Fosco Loregian, Daniele Palombi
Abstract
We provide a categorical interpretation for escrows, i.e. trading protocols in trustless environment, where the exchange between two agents is mediated by a third party where the buyer locks the money until they receive the goods they want from the seller. A simplified escrow system can be modeled as a certain kind of morphism in the category of optics on a monoidal category. When objects in the base category have monoid and comonoid structures, more involved kinds of escrows `with intermediaries' can be modelled as morphisms with action-like properties.
