Bitcoin Forum
May 04, 2024, 07:10:54 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How did Charlie Lee do the LTC/BTC atomic swap?  (Read 173 times)
oshirowanen (OP)
Newbie
*
Offline Offline

Activity: 25
Merit: 10


View Profile
November 07, 2020, 12:10:39 PM
Last edit: November 07, 2020, 09:18:15 PM by oshirowanen
Merited by ABCbits (1)
 #1

Apparently Charlie Lee did a LTC/BTC atomic swap back in 2017, but I can't seem to find how he did it:

Found 2 twitter posts, one mentioned decred and another does not mention decred for atomic swap he performed:

This one mentioned decred: https://twitter.com/satoshilite/status/910534107058233344?lang=en (5:00 PM · Sep 20, 2017)

This one does not: https://twitter.com/satoshilite/status/911328252928643072?lang=en (9:36 PM · Sep 22, 2017)

Regarding the Sep 22, 2017 twitter post, do we know if he used decred for that too, or was that a more direct atomic swap between LTC and BTC?  If it was more direct, did he record the steps he took to perform the transaction, so I can try reproducing them for "learning-by-example" purposes?
1714849854
Hero Member
*
Offline Offline

Posts: 1714849854

View Profile Personal Message (Offline)

Ignore
1714849854
Reply with quote  #2

1714849854
Report to moderator
1714849854
Hero Member
*
Offline Offline

Posts: 1714849854

View Profile Personal Message (Offline)

Ignore
1714849854
Reply with quote  #2

1714849854
Report to moderator
There are several different types of Bitcoin clients. The most secure are full nodes like Bitcoin Core, which will follow the rules of the network no matter what miners do. Even if every miner decided to create 1000 bitcoins per block, full nodes would stick to the rules and reject those blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714849854
Hero Member
*
Offline Offline

Posts: 1714849854

View Profile Personal Message (Offline)

Ignore
1714849854
Reply with quote  #2

1714849854
Report to moderator
1714849854
Hero Member
*
Offline Offline

Posts: 1714849854

View Profile Personal Message (Offline)

Ignore
1714849854
Reply with quote  #2

1714849854
Report to moderator
ChiBitCTy
Legendary
*
Offline Offline

Activity: 2254
Merit: 3007



View Profile
November 07, 2020, 06:34:57 PM
Merited by pooya87 (1), ABCbits (1), friends1980 (1), DougM (1)
 #2

Here ya go.  https://github.com/decred/atomicswap

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits.
..........UNLEASH..........
THE ULTIMATE
GAMING EXPERIENCE
DUELBITS
FANTASY
SPORTS
████▄▄█████▄▄
░▄████
███████████▄
▐███
███████████████▄
███
████████████████
███
████████████████▌
███
██████████████████
████████████████▀▀▀
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
.
▬▬
VS
▬▬
████▄▄▄█████▄▄▄
░▄████████████████▄
▐██████████████████▄
████████████████████
████████████████████▌
█████████████████████
███████████████████
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
/// PLAY FOR  FREE  ///
WIN FOR REAL
..PLAY NOW..
oshirowanen (OP)
Newbie
*
Offline Offline

Activity: 25
Merit: 10


View Profile
November 07, 2020, 08:59:26 PM
Last edit: November 07, 2020, 09:15:55 PM by oshirowanen
 #3


Charlie used Decred for his 2017 LTC/BTC atomic swap?  Is this 100% true?  Surprised if true.

I asked because he did 2 atomic swap posts in 2017, one mentioned decred, the other did not. 

This one mentioned decred: https://twitter.com/satoshilite/status/910534107058233344?lang=en (5:00 PM · Sep 20, 2017)

This one does not: https://twitter.com/satoshilite/status/911328252928643072?lang=en (9:36 PM · Sep 22, 2017)

Do we know if the Sep 22, 2017 was done with or without decred?
ChiBitCTy
Legendary
*
Offline Offline

Activity: 2254
Merit: 3007



View Profile
November 07, 2020, 09:24:15 PM
 #4


Charlie used Decred for his 2017 LTC/BTC atomic swap?  Is this 100% true?  Surprised if true.

I asked because he did 2 atomic swap posts in 2017, one mentioned decred, the other did not. 

This one mentioned decred: https://twitter.com/satoshilite/status/910534107058233344?lang=en (5:00 PM · Sep 20, 2017)

This one does not: https://twitter.com/satoshilite/status/911328252928643072?lang=en (9:36 PM · Sep 22, 2017)

Do we know if the Sep 22, 2017 was done with or without decred?

I asked, he said that’s what he believes he used. ¯\_(ツ)_/¯

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits.
..........UNLEASH..........
THE ULTIMATE
GAMING EXPERIENCE
DUELBITS
FANTASY
SPORTS
████▄▄█████▄▄
░▄████
███████████▄
▐███
███████████████▄
███
████████████████
███
████████████████▌
███
██████████████████
████████████████▀▀▀
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
.
▬▬
VS
▬▬
████▄▄▄█████▄▄▄
░▄████████████████▄
▐██████████████████▄
████████████████████
████████████████████▌
█████████████████████
███████████████████
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
/// PLAY FOR  FREE  ///
WIN FOR REAL
..PLAY NOW..
100bitcoin
Sr. Member
****
Offline Offline

Activity: 860
Merit: 423


View Profile WWW
November 08, 2020, 12:12:15 PM
 #5

Apparently Charlie Lee did a LTC/BTC atomic swap back in 2017, but I can't seem to find how he did it:

Found 2 twitter posts, one mentioned decred and another does not mention decred for atomic swap he performed:

This one mentioned decred: https://twitter.com/satoshilite/status/910534107058233344?lang=en (5:00 PM · Sep 20, 2017)

This one does not: https://twitter.com/satoshilite/status/911328252928643072?lang=en (9:36 PM · Sep 22, 2017)

Regarding the Sep 22, 2017 twitter post, do we know if he used decred for that too, or was that a more direct atomic swap between LTC and BTC?  If it was more direct, did he record the steps he took to perform the transaction, so I can try reproducing them for "learning-by-example" purposes?
All I can see here are two transactions of equal market value at the time of transaction on two different chain. How do we know that they are connected? Is this what meant by atomic swap?

DougM
Full Member
***
Offline Offline

Activity: 173
Merit: 120


View Profile
November 08, 2020, 12:59:19 PM
 #6

Thanks  ChiBitCTy for the link.  I never heard of it before, but your link above provided good insight. In case anyone is equally clueless here is the highlights from the link:

Quote
Decred-compatible cross-chain atomic swapping
This repository contains utilities to manually perform cross-chain atomic swaps between various supported pairs of cryptocurrencies. At the moment, support exists for the following coins and wallets:

Bitcoin (Bitcoin Core)
Bitcoin Cash (Bitcoin ABC, Bitcoin Unlimited, Bitcoin XT)
Decred (dcrwallet)
Litecoin (Litecoin Core)
Monacoin (Monacoin Core)
Particl (Particl Core)
Qtum (Qtum Core)
Vertcoin (Vertcoin Core)
Viacoin (Viacoin Core)
Zcoin (Zcoin Core)
..
These tools do not operate solely on-chain. A side-channel is required between each party performing the swap in order to exchange additional data. This side-channel could be as simple as a text chat and copying data. Until a more streamlined implementation of the side channel exists, such as the Lightning Network, these tools suffice as a proof-of-concept for cross-chain atomic swaps and a way for early adopters to try out the technology.
...
Theory
A cross-chain swap is a trade between two users of different cryptocurrencies. For example, one party may send Decred to a second party's Decred address, while the second party would send Bitcoin to the first party's Bitcoin address. However, as the blockchains are unrelated and transactions can not be reversed, this provides no protection against one of the parties never honoring their end of the trade. One common solution to this problem is to introduce a mutually-trusted third party for escrow. An atomic cross-chain swap solves this problem without the need for a third party.

Atomic swaps involve each party paying into a contract transaction, one contract for each blockchain. The contracts contain an output that is spendable by either party, but the rules required for redemption are different for each party involved.

The image below provides a visual of the steps each party performs and the transfer of data between each party.
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10546



View Profile
November 08, 2020, 01:15:07 PM
Merited by ABCbits (3), Heisenberg_Hunter (1), DougM (1)
 #7

All I can see here are two transactions of equal market value at the time of transaction on two different chain. How do we know that they are connected? Is this what meant by atomic swap?
that is exactly what atomic swaps are. you "swap" one currency for another. you give 10 Dollars and receive 8.42 Euros. you give 10 LTC and receive 0.1337 BTC (in this particular swap).
they are done through smart contracts in a safe and automatic way utilizing the powerful bitcoin script language.

here is the details of the transactions involved in the swap between LTC and BTC posted in OP:
the person with LTC locks 10 LTC into a P2SH output (OP_HASH160 86491d98a99146ab22a066e0d8e6f3a403071af8 OP_EQUAL) created using the following redeem script. in other words makes a deposit into this Litecoin address: ML9CNJBtSPMABYcCQV58P2t4M7MpPRJK95
the redeem script:
Code:
hex = 63a6142c5b442dcfd70ed65b9c90956844525527d9ab3c8876a91497cf2d5d3d30dc84b3aa09d68372d2533753b538670467d9c659b17576a91493cc61870ae8c76ccc7926f5c70dec4f5761a58b6888ac
human readable:
OP_IF
  OP_RIPEMD160 <2c5b442dcfd70ed65b9c90956844525527d9ab3c> OP_EqualVerify OP_DUP OP_HASH160 <97cf2d5d3d30dc84b3aa09d68372d2533753b538>
OP_ELSE
  <67d9c659> OP_CheckLocktimeVerify OP_DROP OP_DUP OP_HASH160 <93cc61870ae3bc3291e0bad4c08d88e41d9ef536>
OP_EndIf
OP_EqualVerify OP_CheckSig
the person with BTC locks 0.1337 BTC in a P2SH output (OP_HASH160 ac938614bf4288b3e41385d49fc0531d847551ff OP_EQUAL) created using the following redeem script. ie. deposit into 3HRWsfjpBHiJ7hC3jKJV5nbHMeBgoCPHDq
Code:
hex= 63a6142c5b442dcfd70ed65b9c90956844525527d9ab3c8876a91497cf2d5d3d30dc84b3aa09d68372d2533753b538670467d9c659b17576a91493cc61870ae8c76ccc7926f5c70dec4f5761a58b6888ac
human readable:
OP_IF
  OP_RIPEMD160 <2c5b442dcfd70ed65b9c90956844525527d9ab3c> OP_EqualVerify OP_DUP OP_HASH160 <3aa29799bae62940f3235cc58e0420359aa0fdf8>
OP_ELSE
  <1b87c659> OP_CheckLocktimeVerify OP_DROP OP_DUP OP_HASH160 <70d0975d5053bc3291e0bad4c08d88e41d9ef536>
OP_EndIf
OP_EqualVerify OP_CheckSig

what this does is that it creates a "condition" to spend this output using if/else. the user either provides some data that could be hashed to have a result equal to "2c5b442dcfd70ed65b9c90956844525527d9ab3c" and then can provide a signature with his own key that spends the output OR if the specified time in the else part is passed the other key owner can provide their own signature and spend this output.
this means no party can spend the coins without either waiting for the time to pass or to reveal the secret making the other party spend their output.

as you see the first hash after the IF is the same which is the secret, the locktimes in ELSE part are timestamps to prevent fraud. the LTC part is at 0x67d9c659 which is 9/23/2017 10:00:07 PM UTC and BTC part is at 0x1b87c659 or 9/23/2017 4:08:59 PM UTC.

the trade completes by one party providing their own signature+public key with the "secret to be hashed" and spending the coins they received. then the other party copies that "secret to be hashed" and uses it in their own transaction on the other chain to spend the coins they received.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
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!