Public swap and private OTC

Swap assets directly with another person, either publishing the trade or keeping it private.

On this page
  1. Two kinds of direct exchange
  2. How an exchange runs
  3. Withdrawing
  4. What each side learns

Two kinds of direct exchange#

Private OTCPublic swap
Pair and quantities publishedNoYes, both assets and both quantities
Appears on the public trade tapeNoYes, with no address or account
Visible that an exchange happenedYesYes
Can feed price chartsNoYes

Choose private OTC when the trade is nobody else's business. Choose a public swap when you want a price on the record.

How an exchange runs#

An exchange is three messages copied between the two people, each beginning lathen-exchange-v4.:

  1. Offer. The initiator reserves its input notes, fixes its two outputs and sends the terms and its two output commitments.
  2. Accept. The responder inspects the terms, reserves its inputs, proves its half and returns it.
  3. Complete. The initiator checks the responder's half with its own verifier, proves its own half and submits both together.

The two halves are settled in one transaction, so either both sides get paid or neither does.

Withdrawing#

A party that has not handed out a proven half can withdraw for free. After that, withdrawing means spending one of the reserved input notes to yourself, which needs one proof and races the other party's submission.

What each side learns#

  • The counterparty learns both assets, both quantities and the other side's two output commitments. It learns no key and no note opening.
  • Everyone else learns what the table above says, plus the usual public fields of every transaction.
Lathen documentation.