What Is That Talk About Cross-Chain Atomic Swaps Between Tron and Steem? by markkujantunen

View this thread on steempeak.com
· @markkujantunen · (edited)
$1.04
What Is That Talk About Cross-Chain Atomic Swaps Between Tron and Steem?
Steemit, Inc wrote in a post titled <a href="https://steemit.com/steemit/@steemitblog/update-townhall-and-witness-meeting">Update: Townhall & Witness Meeting</a>:

>After meeting with the team we all agreed that the best way to progress our missions and add value to one another’s stakeholders is to connect our two powerful blockchains through Cross-Chain Atomic Swaps!

>This would be the first time in history that two blockchains of this size will be connected to one another so that tokens can flow freely, and voluntarily, between the chains without the need for trusted intermediaries like exchanges.

How does this differ from the dreaded token swap from STEEM to a token on the Tron blockchain that Justin Sun announced on the 14th of February? 

The idea was to allow Steem users to swap their STEEM to TRX and back. Such a need might arise when using an app that uses both Steem and Tron.

The "atomic" in the term "cross-chain atomic swap" refers to the swap happening completely or not at all. It is an event that is a single indivisible thing from the user's perspective like an atom is indivisible.

The "cross-chain" in the term simply refers to a swap of tokens on different chains. 

What is required for a (cross-chain) atomic swap to work is for both chains to support <b>hash locks</b> and <b>time locks</b>.

What are those?

A <b>hash lock</b> a type of smart contract that dictates that a token transfer (from an address on a chain to an address on the same chain) only happens when the person who initiates the transfer posts a secret to the chain. It's called a hash lock because the secret itself is not initially published but only a hash (a one-way encryption) of the secret (a number or a string). Calculating the hash of something is quick but calculating that something from the hash is practically impossible. 

A <b>time lock</b> means that there is a time limit for the conditional transaction (the contract) within which it has to take place or it won't happen.

The following steps take place during the execution of an atomic swap where A and B want to exchange tokes on different chains:

A). A sends his coins to a contract address on chain X. The transaction includes the hash of a secret. The idea is that when the contract is fulfilled - which happens when the secret provided to the contract - the coins will be sent to an address completely controlled by B. B can verify that A actually has sent the right amount to the contract address because all the transactions are on a public blockchain. B will also learn the hash of the secret, which he needs for the next step.

B) B sends his coins to a contract address on chain Y and includes <b>the same hash</b> in the transaction. The coins will be sent to A but only if the secret is revealed to the contract on chain Y. But then B can also get his coins because both contracts are fulfilled upon provision of <b>the same secret</b>. That the same secret is needed is verifiable - before the deal goes down - by anyone because the contracts (=conditional transactions) posted to both chains include the same hash, indicating that they are executed upon being provided the same secret. Therefore, A can only get his coins by allowing B to get his coins.

The time locks are needed because it is possible for A to fail to publish the secret at all. Without a time limit, both could end up with their funds in a limbo forever. To give B enough time to claim his coins in case A reveals the secret at the last possible moment, the contract on chain Y will have to give B more time than A.

At present, Steem does not support nor is it intended to ever support user-defined smart contracts. The Steem blockchain does not have hash locks or time locks built in, which means that they would have to be added to the core blockchain code for Steem to be able to participate in cross-chain atomic swaps. Another possibility is to have them done on a side chain (processed by nodes different than Steem consensus ndoes). Steem Engine has user-defined smart contracts in its road map as well as decentralization (it currently has only one server acting upon the Steem-Engine transactions posted to Steem, the Scot bot). Tron has had user-defined smart contracts from the start. It was designed to be a DPoS-based competitor of Ethereum.
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
👎  
properties (23)
post_id84,859,230
authormarkkujantunen
permlinkwhat-is-that-talk-about-cross-chain-atomic-swaps-between-tron-and-steem
categoryatomic-swap
json_metadata{"links":["https:\/\/steemit.com\/steemit\/@steemitblog\/update-townhall-and-witness-meeting"],"tags":["atomic-swap","steem","smartcontract","tron"],"app":"esteem\/2.2.4-mobile","format":"markdown+html","community":"hive-125125"}
created2020-03-01 23:45:39
last_update2020-03-02 07:10:54
depth0
children5
net_rshares8,617,578,796,459
last_payout2020-03-08 23:45:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value1.035 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length4,318
author_reputation340,582,416,232,499
root_title"What Is That Talk About Cross-Chain Atomic Swaps Between Tron and Steem?"
beneficiaries
0.
accountsteemonboarder
weight10,000
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (32)
@freebornangel ·
My bitcoin.com wallet let me swap btc for bch and didn't mention any of that.
Instantly.
Iirc.
properties (22)
post_id84,863,020
authorfreebornangel
permlinkre-markkujantunen-q6jrfs
categoryatomic-swap
json_metadata{"tags":["atomic-swap"],"app":"steempeak\/2020.02.6"}
created2020-03-02 03:38:18
last_update2020-03-02 03:38:18
depth1
children3
net_rshares0
last_payout2020-03-09 03:38:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length94
author_reputation217,103,420,888,695
root_title"What Is That Talk About Cross-Chain Atomic Swaps Between Tron and Steem?"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@markkujantunen ·
That wallet has Shapeshift integrated, that is, it has the ability to act as an interface of the Shapeshift exchange, which is a centralized exchange.

Another possibility to do an atomic swap instantaneously is to use the Lightning Network. In that alternative, everything stays off-chain until a channel is closed.
properties (22)
post_id84,865,610
authormarkkujantunen
permlinkre-freebornangel-q6jzbi
categoryatomic-swap
json_metadata{"tags":["atomic-swap"],"app":"steempeak\/2020.02.6"}
created2020-03-02 06:28:36
last_update2020-03-02 06:28:36
depth2
children2
net_rshares0
last_payout2020-03-09 06:28:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length316
author_reputation340,582,416,232,499
root_title"What Is That Talk About Cross-Chain Atomic Swaps Between Tron and Steem?"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@freebornangel ·
It did say shapeshift, though.
So, they handle the trade like block trades does?
properties (22)
post_id84,866,501
authorfreebornangel
permlinkre-markkujantunen-q6k1r9
categoryatomic-swap
json_metadata{"tags":["atomic-swap"],"app":"steempeak\/2020.02.6"}
created2020-03-02 07:21:12
last_update2020-03-02 07:21:12
depth3
children1
net_rshares0
last_payout2020-03-09 07:21:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length80
author_reputation217,103,420,888,695
root_title"What Is That Talk About Cross-Chain Atomic Swaps Between Tron and Steem?"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@steem-ua ·
#### Hi @markkujantunen!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your **UA** account score is currently 4.399 which ranks you at **#2564** across all Steem accounts.
Your rank has dropped 27 places in the last three days (old rank 2537).

In our last Algorithmic Curation Round, consisting of 90 contributions, your post is ranked at **#20**.
##### Evaluation of your UA score:

* Some people are already following you, keep going!
* The readers appreciate your great work!
* Try to work on user engagement: the more people that interact with you via the comments, the higher your UA score!


**Feel free to join our [@steem-ua Discord server](https://discord.gg/KpBNYGz)**
properties (22)
post_id84,877,480
authorsteem-ua
permlinkre-what-is-that-talk-about-cross-chain-atomic-swaps-between-tron-and-steem-20200302t193035z
categoryatomic-swap
json_metadata{"app":"beem\/0.21.0"}
created2020-03-02 19:30:36
last_update2020-03-02 19:30:36
depth1
children0
net_rshares0
last_payout2020-03-09 19:30:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length737
author_reputation23,203,609,903,979
root_title"What Is That Talk About Cross-Chain Atomic Swaps Between Tron and Steem?"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000