KomodoPlatform / komodo-defi-framework

This is the official Komodo DeFi Framework repository
https://komodoplatform.com/en/docs/komodo-defi-framework/
99 stars 89 forks source link

Support OTC mode #705

Open gcharang opened 4 years ago

gcharang commented 4 years ago

This feature as I imagine it, will bypass the current p2p network based order matching and replaces it with two people chatting with each other on any messaging platform.

The UX might look like the following. Two people discuss and come to an agreement on the coin names, prices and volumes they are both willing to trade at and exchange their pubkeys. Once done, they input these details into a GUI, and the GUI outputs a checksummed+signed hex as a string and/or a QR code. they exchange this string/QR and confirm that they both have the same swap details programmed in. Once sure, they both command the GUI to start the swap and both the mm2 instances start the normal swap process.

This feature also takes care of the historical reputation problem of pubkeys. On these messaging platforms, people have identities and reputations distinct from their pubkeys and people/communities can manage/remember reputations pretty well.

I don't know the current status of the upgraded order matching layer. But this feature can act as a stopgap till the new order matching layer goes online. Even after the new order matching layer goes online, some traders might not be willing to broadcast their orders to the public orderbook and might prefer to use this OTC mode. As I understand it, this feature will add a new way to send ordermatching data to mm2 and the actual atomic swap process won't have any change.

Edit: maker's GUI might also generate a secret and share its hash through the string/QR code.

gcharang commented 3 years ago

https://twitter.com/tobowers/status/1412633045144936449?s=21

Now that p2p ordermatching works pretty well, can pubkey whitelisting and the above "OTC mode" be supported so that many other kinds of users may find value in AtomicDEX?

cc: @tonymorony @artemii235

artemii235 commented 3 years ago

We already have a starting point for such OTC mode - there is a match_by argument for buy/sell RPCs: https://developers.atomicdex.io/basic-docs/atomicdex/atomicdex-api.html#arguments-6 that allows picking a specific pubkey. We can add the same for setprice and also the argument to not broadcast the OTC order to the network. GUIs can use it then to build the QRs or API can generate them. Later, for more privacy, we can also add an encryption layer on P2P messages for OTC trade.