https://twitter.com/carsenjk/status/9702954767370280961st Atomic Swap on the Denarius blockchain happened today.
>>>>>>>>>>>>>>>>>>>>>>>>>
SWAP completed! 2023289721-1482595363 {"expiration":1520185639,"tradeid":2761284761,"requestid":2023289721,"quoteid":1482595363,"iambob":0,"Bgui":"","Agui":"simplegui","gui":"simplegui","bob":"KMD","srcamount":0.49629541,"bobtxfee":0.00001000,"alice":"DNR","destamount":0.50000000,"alicetxfee":0.00010000,"aliceid":"3334649535691554817","sentflags":["alicespend", "bobpayment", "alicepayment", "bobdeposit", "myfee"],"values":[0.49630541, 0, 0.49631541, 0.50020000, 0.55835233, 0, 0.00064350, 0, 0, 0, 0],"result":"success","status":"finished","finishtime":1520170285,"bobdeposit":"021efa09b1ad845e3066e4a0827fb4c10542a22c94e27c76e105d07050ec4e57","alicepayment":"a1a1dd1ce6cea4f0b32aa3c9e349befc4f6f48fe670744e2d70a37a13ddd0627","bobpayment":"593b84c90f390cfaf3cd912e6d7093d539787b023acd82c2681ca465ae8b89cb","paymentspent":"7847cedbf6ef66961e87b7d2152ec0f41915f82f88e0b362bf312d59f7eb88de","Apaymentspent":"0000000000000000000000000000000000000000000000000000000000000000","depositspent":"0000000000000000000000000000000000000000000000000000000000000000","method":"tradestatus","finishtime":1520170285}
For those that don't know:
For people who don't know, an atomic swap is an exchange between two different cryptocurrencies that happens simultaneously and without the need for a third party.
The first step in performing an atomic swap is you and the other party needs to agree on an exchange rate. For example, you can go from BTC -> LTC, LTC -> DNR, DNR-> BTC and any other combination of currencies. Atomic swaps can be performed with a wide range of coins, which one day could open up the doors for a fully decentralized exchange.
Once the exchange rate has been decided the first party, refered here on in as the "initiator," creates a special type of wallet address. Along with this, the initiator creates a "secret number" that only he knows. If you think of the number as a key, the hash of the secret number is the lock. The hash is like the specifications of the lock, so you can attach the hash to the wallet address and have the secret number be able to be used as a key.
This address, or contract as its sometimes referenced as, is special as it needs more than just someones signature to spend the funds inside. The contract needs both the secret number and the signature of the second party (also known as participant)
At the beginning of the swap, neither party can spend funds associated with the contract. The intiator has only the secret number, and the second party, refered here on is as the participant, has his own signature. Neither have both requirements. Once the initiator sends funds to the contract address, he can't get them back unless the participate cancels the trade. In the scenario of a cancellation, the contract is time locked so the funds will be refunded if the swap never occurs.
The participant then audits the contract and make sure everything is in order. The initiator provides the secret number hash to the participant, who in turn creates an identical contract address, but with slightly different requirements. The participant's contract requires the secret number and the initiator's signature. The participant then sends his funds to the address.
You may be like wait! The Initiator now has both requirements to redeem and spend the funds in the participants contract! My money!
But that's how its supposed to work. If the initiator uses the secret number to unlock the box, the secret number is broadcasted for all to see, including the participant.The participant now has both requirements for the initiators contract and can redeem his funds.
TLDR: Atomic SWAPS is an exchange between two different cryptocurrencies