Friday, 4 January 2019

[suggestion] Standardized protocol for on-chain atomic swap requests

Atomic swaps are awesome. I was interested in how it works, so I had a look at Atomic wallet, went to the "markets" section and, well, there's no swap offers at all 😞. I don't know how Atomic wallet records swap requests, but I'm going to assume they're running some kind of wallet specific database to connect the two interested parties.

A quick recap, in order to initiate an atomic swap, both parties have to enter a transaction on each chain recording a timelock, hash of the preimage and where to send the coins if a second transaction appears on that blockchain that has the plaintext preimage.

I would suggest that there should be a standardized format/protocol to record a request for a swap on-chain. It should contain:

  • How long that request is considered "active"
  • Where to send the coins (for the one initiating the atomic swap)
  • Requested currency symbol and amount
  • Offered amount (of currency on that chain)

This accomplishes several interesting things, such as:

  • No side communication: since the next step in accepting a request is to initiate an atomic swap, and the one who made the request can scan the other chain for that to see if anybody picked up on their request
  • Inter-wallet compatibility: Wallets can browse a blockchain looking for active swap offers (so the swaps you can find do not depend on the user-population of whatever communication channel a particular wallet implements)
  • Decentralized price discovery: A chart can be drawn from the requests (i.e. bids) and eventual swaps (i.e. ticks) for the exchange price (therefore giving users an idea if a request for a swap is fair or not without having to consult centralized exchanges price information)

The success criteria for this suggestion is:

  • That a specification of this protocol is produced for each chain
  • That wallets able to operate multiple chains integrate this protocol, and use it to populate a list of swap requests and draw historical price/volume charts from the swaps that happened.

I would consider it a fantastic success if different wallet developers would come together and agree on such a protocol. It would not only be an outstanding example of cryptocurrency community cooperation to address user needs, it would also be a killer application for decentralization (away from exchanges) and on-chain scaling.

submitted by /u/pyalot
[link] [comments]

source https://www.reddit.com/r/btc/comments/ach56t/suggestion_standardized_protocol_for_onchain/

No comments:

Post a Comment