3 min read

Atomic Swaps are coming to Zenon Network

Atomic Swaps are coming to Zenon Network

(Any views expressed in the below are the personal views of the author and should not form the basis for making investment decisions, nor be construed as a recommendation or advice to engage in investment transactions.)

The development community has written the code to enable Hashed Time Locked Contracts (HTLCs) on Zenon Network.

Once the code is accepted users will be able to perform trustless swaps with the Zenon CLI tool (.NET and Dart). In addition, developers are working to add Atomic Swaps to SYRIUS v0.0.7. We can expect this feature in the coming months. It will come with a nice graphical user interface and a guided experience making trustless swaps easy.

What is an Atomic Swap?

An atomic swap is an exchange of cryptocurrencies conducted between two parties without the trust of a 3rd party intermediary.

What are the steps to perform an Atomic Swap?

  1. For example, Alice and Bob are strangers that meet online and they agree to trade ZTS tokens with each other.
  2. Alice creates a Hashed Timelocked Contract (HTLC) by locking an amount of ZTS tokens ($ZNN, $QSR, or any other ZTS) in the HTLC embedded contract with a secret that only she knows about.
  3. The secret's hash, known as the hashlock, is published with the transaction.
  4. She sends the HTLC transaction hash to Bob using an out-of-band communication method, like email or social media.
  5. Bob performs a lookup of the transaction to verify the expected amount has been locked, and saves the hashlock for his transaction.
  6. Bob then creates a new HTLC using the same hashlock, locking his own ZTS funds. Then he sends Alice his transaction hash.
  7. Upon confirming that Bob has locked the correct funds, Alice will use the secret she generated in the first step to unlock the HTLC that Bob created. Upon unlocking the funds the secret is published on chain allowing anyone monitoring transactions to see the secret in plaintext.
  8. Using the secret he found on-chain, Bob can unlock the funds that Alice deposited for him.

SYRIUS v0.0.7 abstracts away the complexity of an atomic swaps and turns them into graphical steps that are easy to follow.

When are Atomic Swaps coming to Zenon Network?

Many community developers are working on implementing Atomic Swaps in SYRIUS v0.0.7. The devs have not committed to a deadline but we can expect a working prototype in the coming months. The contract that enabled HTLCs is complete and waiting to be reviewed by Mr. Kaine.

Add support for Hash(ed) Time Lock(ed) Contracts (HTLC) by georgezgeorgez · Pull Request #11 · zenon-network/go-zenon
Contribute to zenon-network/go-zenon development by creating an account on GitHub.

Why are Atomic Swaps Important?

What is the current state of Design?

The community has decided on a guided experience over a technical, open-ended approach. @Vilkris has prepared two design options for the community to review and provide feedback.

Prototype 1

Figma design files

Prototype 2

Figma design files

How can I get involved?

The community is discussing Atomic Swaps on the forum. Which prototype do you like more, prototype 1 or 2?

Visit the forum post discussing the prototypes and let your void be heard.

Community Call

The Zenon community decided to advance a guided swap experience. Feel free to watch the video where we discuss that decision below.

Atomic Swap Reference Implementations

@Vilkris researched several reference implementations when designing the guided experience. Surprisingly, there are very few good working examples of "real" atomic swaps.

Koinos has implemented a primitive Atomic Swap experience. You can see the website and video walk-through below.

Hashed Timelock Contract - Koinos - EVM