» What is the deal execution script?

SINGLE STUDY CRYPTO

April 9, 2019

What is the deal execution script?

When the matcher finds two proper orders, it sends them to the deal execution engine which inititates and orchestrates the atomic swap procedure between two clients - atomic deal.

Atomic deal consists of 6 steps:

  • Request for deal
    • Server generates preliminary information for parties, contracts samples and waits for confirmations from both to take part in this deal.
  • InitScriptRequest
    • Party One generates atomic swap init transaction on the first blockchain to lock funds.
    • Party One’s init transaction is pushed to the first blockchain and confirmed.
  • SecondScriptRequest
    • Party Two validates locked funds on the first blockchain.
    • Party Two generates atomic swap init transaction on the second blockchain to lock funds.
    • Party Two’s transaction is pushed to the second blockchain and confirmed.
  • Redeem B
    • Party One generates transaction to redeem funds from the second blockchain.
    • Party One’s redeem transaction is pushed to the second blockchain and confirmed.
  • Redeem A
    • Party Two generates transaction to redeem funds from the first blockchain.
    • Party Two’s redeem transaction is pushed to the first blockchain and confirmed.
  • Refund (if needed)
    • In case if something goes wrong - either party can refund its locked funds after a timeout.