Bitcoin Forum
May 06, 2024, 07:56:30 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Understanding Atomic Swaps  (Read 191 times)
MadGamer (OP)
Legendary
*
Offline Offline

Activity: 1568
Merit: 1031


View Profile
May 26, 2018, 11:45:41 AM
 #1

My current understanding is that Atomic swaps will allow exchange between multiple crypto currencies in a trustless way without the need of a third party.

If Lightning network is going to be a requirement to activate it. Does it mean that It's going to be impossible to trade ETH to BTC as ETH has no LN? Atomic swaps have to be developed in each currency in order to be able to use it to exchange?
Make sure you back up your wallet regularly! Unlike a bank account, nobody can help you if you lose access to your BTC.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
DooMAD
Legendary
*
Offline Offline

Activity: 3780
Merit: 3104


Leave no FUD unchallenged


View Profile
May 26, 2018, 02:49:28 PM
Last edit: May 26, 2018, 03:00:52 PM by DooMAD
 #2

My current understanding is that Atomic swaps will allow exchange between multiple crypto currencies in a trustless way without the need of a third party.

If Lightning network is going to be a requirement to activate it. Does it mean that It's going to be impossible to trade ETH to BTC as ETH has no LN? Atomic swaps have to be developed in each currency in order to be able to use it to exchange?

Indeed.  ETH could have it's own type of Atomic Swap mechanism, but it likely wouldn't be compatible with the Lightning implementation.  Some coins can already do Atomic Swaps without Lightning.  I recall Burst and Qora did it what seems like ages ago now, then Litecoin and Decred did it earlier this year.  So there are definitely workarounds that don't involve Lightning, but I get the sense that Lightning's method will be comparatively easier and more convenient.  

To confuse matters, apparently there's a distinction to be made between "on-chain atomic swaps" and "off-chain atomic swaps".  On-chain atomic swaps have to have the same hash algorithm for both coins.  Off-chain atomic swaps won't have that limitation.

There's probably still time for some standardisation to occur, since it's all still very much in its infancy.  With the immense network effects that Bitcoin commands, that will probably have the biggest influence on how most coins try to implement it.  It's fair to assume most coins would want to be compatible with BTC if they can.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
noobWithAComputer
Newbie
*
Offline Offline

Activity: 8
Merit: 24


View Profile
July 16, 2018, 02:21:37 PM
Merited by ABCbits (1)
 #3

The concept of an atomic swap is not a part of the lightning network.

It's just a structure of transactions utilizing hashed timelock contracts (HTLCs) in order to achieve a trustless exchange of different currencies on different chains. Until now multiple atomic swaps were made on bitcoin.
ATM I'm writing a thesis about atomic swaps and how to recognize them. There are a few different scripts for HTLCs, but they all do the same thing: they lock value for a specific time, except the counterparty can provide the preimage of the given hash.

One implementation of an HTLC looks like this:
Code:
63	if
82 size
01 data1
20
88 equalverify
a8 sha256
20 data32
<secret_hash 32byte>
88 equalverify
76 dup
a9 hash160
14 data20
<pubkey_hash1 20byte>
67 else
04 data4
<timelock 4byte>
b1 checklocktimeverify
75 drop
76 dup
a9 hash160
14 data20
<pubkey_hash2 20byte>
68 endif
88 equalverify
ac checksig

In order to have an atomic swap you just need an implementation which achieves the same thing. In ethereum you could also write a smart contract which does the same. As far as both parties can watch the blockchain and what is happening there, it is possible to make an atomic swap.
Kallisteiros
Copper Member
Member
**
Offline Offline

Activity: 85
Merit: 122


View Profile
July 16, 2018, 05:41:08 PM
 #4

If Lightning network is going to be a requirement to activate it. Does it mean that It's going to be impossible to trade ETH to BTC as ETH has no LN?
Not only lightning network is not required at all for atomic swaps, but lightning channels cannot even be used for atomic swaps AFAIK.

Quote
Atomic swaps have to be developed in each currency in order to be able to use it to exchange?
Both blockchains should support hashed timelock contracts (HTLCs), that is, allow the transaction to be spent if either the time has run out or the preimage of a specific hash is provided, that will allow to release the transaction on the other blockchain. In Bitcoin-based blockchains, they should support BIP-199, in Ethereum it can be emulated by smart contracts.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!