SlideShare a Scribd company logo
1 of 14
Download to read offline
TUCSON BLOCKCHAIN DEVELOPERS
Aug 2, 2018 - Cross-Chain Atomic Swaps
Agenda:
5min - Sponsor
10min - Introductions
45min - Atomic Swaps by Destry
15min - Discussion/Planning
Ground Rules:
1. No Prices. No Politics.
2. Don’t be an asshole.
This week’s sponsors:
Borderlands Brewery & Unchained-Capital.com
First, a Problem.
I have BTC.
I want ETH.
What do I do?
Cross-Chain Atomic Swaps
“A atomic swap protocol guarantees:
1: if all parties conform to the protocol, then all swaps take place,
2: if some parties deviate from the protocol, then no conforming party ends up
worse o ff,
3: no coalition has an incentive to deviate from the protocol.” [2]
So it requires a number of steps to be executed in the correct order by multiple
(possibly adversarial) parties.
It’s not as simple as ‘all valid or all invalid’.
TimeLocks
TimeLocks are easy: “True after block X, False until then”
So you can say:
“Ben can spend this $ until Block 500, after which Destry can spend this $”
You’ll see in a minute why this is important.
Hashlocks
Remember a hash is a one-way function:
s (secret) -> hash function -> h (hash of the secret)
You can’t get s even if you have h and the hash function.
Hashlock:
Transaction is only true if you can provide s.
To hashlock, you write h into the encumbering script.
Let’s combine a hashlock and a timelock.
Ben gives me h, says he has s, but isn’t going to tell me unless I pay him some
BTC.
I could create a script that says:
“Provide Ben’s Address’s Signature and s for this h”
But then Ben could disappear and I’ve lost my BTC. So instead:
“Before Block 500: Provide Ben’s Address’ Signature and s for this h,
After Block 500: Provide Destry’s Address’ Signature”
(Ben wants the TimeLock so he knows I can’t grab the BTC while his transaction
is pending.)
So how do Time and Hash Locks enable swaps?
I have BTC, Ben has ETH.
1. I create a secret s and hash(s), h.
2. I send my BTC to Ben’s address with hashlock h, and 2 day timelock.
3. Once Ben sees my transaction, he sends his ETH to a contract with:
hashlock h, and 1 day timelock.
4. I want those ETH, so within 1 day, I move the ETH to my wallet, exposing s.
5. Ben is watching and sees my transaction with s, he has 1 day to move the
BTC to his wallet.
https://blog.lightning.engineering/
announcement/2017/11/16/ln-sw
ap.html
Circles!
Technically - Bitcoin
Bitcoin Hashed Time-Locked Contract (HTLC)
https://github.com/bitcoin/bips/blob/master/bip-0199.mediawiki
HTLCs are what enable the Lightning Network...
We’ll save that for another day.
Interesting Dates
● 2014 - Komodo founder completes first BTC/NXT swap[3]
● Sept 19, 2017 - First Decred/Litcoin Atomic Swap
https://blog.decred.org/2017/09/20/On-Chain-Atomic-Swaps/
● Nov 17, 2017 - Lighting network does Bitcoin testnet-Litcoin testnet off-chain
atomic swap.
https://blog.lightning.engineering/announcement/2017/11/16/ln-swap.html
References
1. M. Herlihy, Atomic Cross-Chain Swaps. https://arxiv.org/abs/1801.09515
2. S. Bowe and D. Hopwood. Hashed time-locked contract transactions. htt
ps://github.com/bitcoin/bips/blob/master/bip-0199.mediawiki. As of 2 August 2018
3. https://blog.komodoplatform.com/everything-you-need-to-know-about-atomic-swaps-and-how-komo
do-is-advancing-the-technology-cadaec50da7c

More Related Content

Similar to Tucson Blockchain Developers Discuss Atomic Swaps

Webinar on BITCOIN FORENSICS : BRIGHTTALK
Webinar on BITCOIN FORENSICS : BRIGHTTALKWebinar on BITCOIN FORENSICS : BRIGHTTALK
Webinar on BITCOIN FORENSICS : BRIGHTTALKanupriti
 
Every thing bitcoin in baby language
Every thing bitcoin in baby languageEvery thing bitcoin in baby language
Every thing bitcoin in baby languageOssai Nduka
 
Bitcoin A Peer-to-Peer Electronic Cash System
Bitcoin A Peer-to-Peer Electronic Cash SystemBitcoin A Peer-to-Peer Electronic Cash System
Bitcoin A Peer-to-Peer Electronic Cash SystemFlavio Vit
 
LESSON 3 BLOCKCHAIN TRANSPARENCY _ BLOCKCHAIN SECURITY _ BITCOIN VS BLOCKCHAI...
LESSON 3 BLOCKCHAIN TRANSPARENCY _ BLOCKCHAIN SECURITY _ BITCOIN VS BLOCKCHAI...LESSON 3 BLOCKCHAIN TRANSPARENCY _ BLOCKCHAIN SECURITY _ BITCOIN VS BLOCKCHAI...
LESSON 3 BLOCKCHAIN TRANSPARENCY _ BLOCKCHAIN SECURITY _ BITCOIN VS BLOCKCHAI...Leapwaters
 
How Does Bitcoin Work? Under the Hood for Dummies | ProvenCrypto
How Does Bitcoin Work? Under the Hood for Dummies | ProvenCryptoHow Does Bitcoin Work? Under the Hood for Dummies | ProvenCrypto
How Does Bitcoin Work? Under the Hood for Dummies | ProvenCryptoOpti Network
 
BLOCKCHAIN PPT.pptx
BLOCKCHAIN PPT.pptxBLOCKCHAIN PPT.pptx
BLOCKCHAIN PPT.pptxSohanaAmreen
 
Cryptocurrency-Bitcoin
Cryptocurrency-BitcoinCryptocurrency-Bitcoin
Cryptocurrency-BitcoinSatwikaHotwani
 
BlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes Zweng
BlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes ZwengBlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes Zweng
BlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes ZwengBlockchainHub Graz
 
Bitcoin-the Currency of Future
Bitcoin-the Currency of FutureBitcoin-the Currency of Future
Bitcoin-the Currency of FutureNiraj Dholakia
 
PRESENTATION.pptx
PRESENTATION.pptxPRESENTATION.pptx
PRESENTATION.pptxFaiZiTricks
 
Bitcoin in general - presentation
Bitcoin in general - presentationBitcoin in general - presentation
Bitcoin in general - presentationMichal Cisárik
 
A primer on Bitcoin Technology
A primer on Bitcoin TechnologyA primer on Bitcoin Technology
A primer on Bitcoin TechnologySebin Benjamin
 
Bitcoin Forensics
Bitcoin ForensicsBitcoin Forensics
Bitcoin Forensicsanupriti
 
Bitcoin - Understanding and Assessing potential Opportunities
Bitcoin - Understanding and Assessing potential OpportunitiesBitcoin - Understanding and Assessing potential Opportunities
Bitcoin - Understanding and Assessing potential OpportunitiesQuasarVentures
 
Bitcoins: Application of blockchain technology
Bitcoins: Application of blockchain technologyBitcoins: Application of blockchain technology
Bitcoins: Application of blockchain technologyShiv Sahni
 

Similar to Tucson Blockchain Developers Discuss Atomic Swaps (20)

Webinar on BITCOIN FORENSICS : BRIGHTTALK
Webinar on BITCOIN FORENSICS : BRIGHTTALKWebinar on BITCOIN FORENSICS : BRIGHTTALK
Webinar on BITCOIN FORENSICS : BRIGHTTALK
 
Every thing bitcoin in baby language
Every thing bitcoin in baby languageEvery thing bitcoin in baby language
Every thing bitcoin in baby language
 
Bitcoin A Peer-to-Peer Electronic Cash System
Bitcoin A Peer-to-Peer Electronic Cash SystemBitcoin A Peer-to-Peer Electronic Cash System
Bitcoin A Peer-to-Peer Electronic Cash System
 
LESSON 3 BLOCKCHAIN TRANSPARENCY _ BLOCKCHAIN SECURITY _ BITCOIN VS BLOCKCHAI...
LESSON 3 BLOCKCHAIN TRANSPARENCY _ BLOCKCHAIN SECURITY _ BITCOIN VS BLOCKCHAI...LESSON 3 BLOCKCHAIN TRANSPARENCY _ BLOCKCHAIN SECURITY _ BITCOIN VS BLOCKCHAI...
LESSON 3 BLOCKCHAIN TRANSPARENCY _ BLOCKCHAIN SECURITY _ BITCOIN VS BLOCKCHAI...
 
How Does Bitcoin Work? Under the Hood for Dummies | ProvenCrypto
How Does Bitcoin Work? Under the Hood for Dummies | ProvenCryptoHow Does Bitcoin Work? Under the Hood for Dummies | ProvenCrypto
How Does Bitcoin Work? Under the Hood for Dummies | ProvenCrypto
 
BLOCKCHAIN PPT.pptx
BLOCKCHAIN PPT.pptxBLOCKCHAIN PPT.pptx
BLOCKCHAIN PPT.pptx
 
Cryptocurrency-Bitcoin
Cryptocurrency-BitcoinCryptocurrency-Bitcoin
Cryptocurrency-Bitcoin
 
BlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes Zweng
BlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes ZwengBlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes Zweng
BlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes Zweng
 
Bitcoin-the Currency of Future
Bitcoin-the Currency of FutureBitcoin-the Currency of Future
Bitcoin-the Currency of Future
 
PRESENTATION.pptx
PRESENTATION.pptxPRESENTATION.pptx
PRESENTATION.pptx
 
Bitcoin in general - presentation
Bitcoin in general - presentationBitcoin in general - presentation
Bitcoin in general - presentation
 
A primer on Bitcoin Technology
A primer on Bitcoin TechnologyA primer on Bitcoin Technology
A primer on Bitcoin Technology
 
Bitcoin
BitcoinBitcoin
Bitcoin
 
CRYPTOCURRENCY
CRYPTOCURRENCYCRYPTOCURRENCY
CRYPTOCURRENCY
 
Bitcoin Forensics
Bitcoin ForensicsBitcoin Forensics
Bitcoin Forensics
 
Bitcoin quiz
Bitcoin quizBitcoin quiz
Bitcoin quiz
 
Introduction to bitcoin
Introduction to bitcoinIntroduction to bitcoin
Introduction to bitcoin
 
Blockchain
BlockchainBlockchain
Blockchain
 
Bitcoin - Understanding and Assessing potential Opportunities
Bitcoin - Understanding and Assessing potential OpportunitiesBitcoin - Understanding and Assessing potential Opportunities
Bitcoin - Understanding and Assessing potential Opportunities
 
Bitcoins: Application of blockchain technology
Bitcoins: Application of blockchain technologyBitcoins: Application of blockchain technology
Bitcoins: Application of blockchain technology
 

More from Destry Saul

Tucson Blockchain Developers Meetup - Sept 27 - Signed messages in ethereum p...
Tucson Blockchain Developers Meetup - Sept 27 - Signed messages in ethereum p...Tucson Blockchain Developers Meetup - Sept 27 - Signed messages in ethereum p...
Tucson Blockchain Developers Meetup - Sept 27 - Signed messages in ethereum p...Destry Saul
 
TBD - Sept 13, 2018 - Signed messages in ethereum - destry saul
TBD - Sept 13, 2018 - Signed messages in ethereum - destry saulTBD - Sept 13, 2018 - Signed messages in ethereum - destry saul
TBD - Sept 13, 2018 - Signed messages in ethereum - destry saulDestry Saul
 
Fluent destry saul
Fluent destry saulFluent destry saul
Fluent destry saulDestry Saul
 
Proof of stake - Tucson Blockchain Devs Meetup #5
Proof of stake - Tucson Blockchain Devs Meetup #5Proof of stake - Tucson Blockchain Devs Meetup #5
Proof of stake - Tucson Blockchain Devs Meetup #5Destry Saul
 
Tucson Blockchain Dev Meetup - Unchained Capital's Multisig Ethereum Contract
Tucson Blockchain Dev Meetup - Unchained Capital's Multisig Ethereum ContractTucson Blockchain Dev Meetup - Unchained Capital's Multisig Ethereum Contract
Tucson Blockchain Dev Meetup - Unchained Capital's Multisig Ethereum ContractDestry Saul
 
Tucson Blockchain Developers Meetup #1 - Cryptokitties by Destry
Tucson Blockchain Developers Meetup #1 - Cryptokitties by DestryTucson Blockchain Developers Meetup #1 - Cryptokitties by Destry
Tucson Blockchain Developers Meetup #1 - Cryptokitties by DestryDestry Saul
 

More from Destry Saul (7)

Tucson Blockchain Developers Meetup - Sept 27 - Signed messages in ethereum p...
Tucson Blockchain Developers Meetup - Sept 27 - Signed messages in ethereum p...Tucson Blockchain Developers Meetup - Sept 27 - Signed messages in ethereum p...
Tucson Blockchain Developers Meetup - Sept 27 - Signed messages in ethereum p...
 
TBD - Sept 13, 2018 - Signed messages in ethereum - destry saul
TBD - Sept 13, 2018 - Signed messages in ethereum - destry saulTBD - Sept 13, 2018 - Signed messages in ethereum - destry saul
TBD - Sept 13, 2018 - Signed messages in ethereum - destry saul
 
Fluent destry saul
Fluent destry saulFluent destry saul
Fluent destry saul
 
Proof of stake - Tucson Blockchain Devs Meetup #5
Proof of stake - Tucson Blockchain Devs Meetup #5Proof of stake - Tucson Blockchain Devs Meetup #5
Proof of stake - Tucson Blockchain Devs Meetup #5
 
Tucson Blockchain Dev Meetup - Unchained Capital's Multisig Ethereum Contract
Tucson Blockchain Dev Meetup - Unchained Capital's Multisig Ethereum ContractTucson Blockchain Dev Meetup - Unchained Capital's Multisig Ethereum Contract
Tucson Blockchain Dev Meetup - Unchained Capital's Multisig Ethereum Contract
 
Erc20
Erc20Erc20
Erc20
 
Tucson Blockchain Developers Meetup #1 - Cryptokitties by Destry
Tucson Blockchain Developers Meetup #1 - Cryptokitties by DestryTucson Blockchain Developers Meetup #1 - Cryptokitties by Destry
Tucson Blockchain Developers Meetup #1 - Cryptokitties by Destry
 

Recently uploaded

New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 

Recently uploaded (20)

New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 

Tucson Blockchain Developers Discuss Atomic Swaps

  • 1. TUCSON BLOCKCHAIN DEVELOPERS Aug 2, 2018 - Cross-Chain Atomic Swaps Agenda: 5min - Sponsor 10min - Introductions 45min - Atomic Swaps by Destry 15min - Discussion/Planning Ground Rules: 1. No Prices. No Politics. 2. Don’t be an asshole. This week’s sponsors: Borderlands Brewery & Unchained-Capital.com
  • 2.
  • 3. First, a Problem. I have BTC. I want ETH. What do I do?
  • 4. Cross-Chain Atomic Swaps “A atomic swap protocol guarantees: 1: if all parties conform to the protocol, then all swaps take place, 2: if some parties deviate from the protocol, then no conforming party ends up worse o ff, 3: no coalition has an incentive to deviate from the protocol.” [2] So it requires a number of steps to be executed in the correct order by multiple (possibly adversarial) parties. It’s not as simple as ‘all valid or all invalid’.
  • 5. TimeLocks TimeLocks are easy: “True after block X, False until then” So you can say: “Ben can spend this $ until Block 500, after which Destry can spend this $” You’ll see in a minute why this is important.
  • 6. Hashlocks Remember a hash is a one-way function: s (secret) -> hash function -> h (hash of the secret) You can’t get s even if you have h and the hash function. Hashlock: Transaction is only true if you can provide s. To hashlock, you write h into the encumbering script.
  • 7. Let’s combine a hashlock and a timelock. Ben gives me h, says he has s, but isn’t going to tell me unless I pay him some BTC. I could create a script that says: “Provide Ben’s Address’s Signature and s for this h” But then Ben could disappear and I’ve lost my BTC. So instead: “Before Block 500: Provide Ben’s Address’ Signature and s for this h, After Block 500: Provide Destry’s Address’ Signature” (Ben wants the TimeLock so he knows I can’t grab the BTC while his transaction is pending.)
  • 8. So how do Time and Hash Locks enable swaps? I have BTC, Ben has ETH. 1. I create a secret s and hash(s), h. 2. I send my BTC to Ben’s address with hashlock h, and 2 day timelock. 3. Once Ben sees my transaction, he sends his ETH to a contract with: hashlock h, and 1 day timelock. 4. I want those ETH, so within 1 day, I move the ETH to my wallet, exposing s. 5. Ben is watching and sees my transaction with s, he has 1 day to move the BTC to his wallet.
  • 11. Technically - Bitcoin Bitcoin Hashed Time-Locked Contract (HTLC) https://github.com/bitcoin/bips/blob/master/bip-0199.mediawiki
  • 12. HTLCs are what enable the Lightning Network... We’ll save that for another day.
  • 13. Interesting Dates ● 2014 - Komodo founder completes first BTC/NXT swap[3] ● Sept 19, 2017 - First Decred/Litcoin Atomic Swap https://blog.decred.org/2017/09/20/On-Chain-Atomic-Swaps/ ● Nov 17, 2017 - Lighting network does Bitcoin testnet-Litcoin testnet off-chain atomic swap. https://blog.lightning.engineering/announcement/2017/11/16/ln-swap.html
  • 14. References 1. M. Herlihy, Atomic Cross-Chain Swaps. https://arxiv.org/abs/1801.09515 2. S. Bowe and D. Hopwood. Hashed time-locked contract transactions. htt ps://github.com/bitcoin/bips/blob/master/bip-0199.mediawiki. As of 2 August 2018 3. https://blog.komodoplatform.com/everything-you-need-to-know-about-atomic-swaps-and-how-komo do-is-advancing-the-technology-cadaec50da7c