json_metadata | "{"app":"musing/1.1","appTags":["Blockchain","question"],"appCategory":"Blockchain","appTitle":"How do the transactions across the blockchains get executed by atomic swap?","appBody":"<p>This means that the currency can now be exchanged for other currencies, such as Bitcoin, without having to rely on a trusted third party, and with a very low risk. This exchange can be conducted through a process based on the scripting language of Bitcoin and its derivatives.</p>\n<p>This makes it possible to contract within the framework of a hash time-locked contract (HTLC), an intelligent contract making it possible to set up basic agreements.</p>\n<p>The transaction must take place with a time limit. If this time is exceeded, then the swap contract is not executed.</p>\n<p>Due to the use of a private key, the exchange can take place without any of the users can cheat.</p>\n<p>Let's take a simple example. Two individuals, Alice and Bob, would like to trade 1BTC against 15BCH.</p>\n<p><strong>Alice will give Bob crypto-currencies on the A chain (here 1 Bitcoin)</strong></p>\n<p><strong>In return, Bob will give Alice crypto-currencies on the B-channel (here 15 BCH)</strong></p>\n<p>But they do not wish for that to address a third party, and would like to contract alone. However, they can not trust each other for the exchange, since they do not know each other.</p>\n<p>They will therefore rely on an Atomic Cross Chain Swap (ACCS):</p>\n<p><br></p>\n<p><img src=\"https://www.crypto-france.com/wp-content/uploads/2017/11/atomic-cross-chain-swap.jpg\" /></p>\n<p><br></p>\n<p>Alice will create a conditional transaction: this is to give Bob 1 Bitcoin if he can sign with his secret hash (his private key), or if both parties sign it. She will then create a second transaction, which will allow her to recover her funds, but only within 48 hours.</p>\n<p>Bob will do the same thing, but this time with 15 Bitcoin Cash (BCH).</p>\n<p>To obtain the fruit of the exchange, each individual will then have to provide cryptographic evidence of their payment, which they are, at that time, both able to do. They also have the opportunity to sign an agreement so that everyone can get the other's currency.</p>\n<p>If this is not the case - that is, if the cryptographic evidence can not be sent to the network, or if both do not agree, the currencies are simply returned to their original owners.</p>\n<p>The advantage is clear: this exchange does not require any trusted third party.</p>\n<p>Indeed, during this 48 hour period, they can each obtain the cryptocurrency of the other. And if, for one reason or another, they do not, digital currencies are returned to their original owner.</p>\n<p>This time window is important. Indeed, it is unclear whether the Bitcoin network will be able to manage these atomic swaps if they are initiated during a congestion of the network, which could extend the transaction times to several days.</p>\n<p>This is the reason why this type of exchange requires however to trust an entity: the network on which it takes place. Indeed, the contracting parties must have confidence in the network's ability to manage their cryptographic evidence during the expected time window, and possibly to return the funds if the transaction does not take place.</p>\n<p>This feature can however be particularly useful, since it allows to set up decentralized exchanges, without trusted third parties, between different crypto-currencies that support these swaps.</p>","appDepth":2,"appParentPermlink":"fknm6qbzw","appParentAuthor":"groynes","musingAppId":"aU2p3C3a8N","musingAppVersion":"1.1","musingPostType":"answer"}" |
---|