-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswaps.html
More file actions
146 lines (133 loc) · 11.2 KB
/
Copy pathswaps.html
File metadata and controls
146 lines (133 loc) · 11.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<!DOCTYPE html>
<!-- SPDX-License-Identifier: AGPL-3.0-or-later | TestnetHub © 2026 Tech1k -->
<html lang="en" data-theme="dark">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>How atomic swaps work with TestnetSwap · TestnetHub</title>
<meta name="description" content="Try non-custodial atomic swaps between testnet coins with TestnetSwap, and learn how HTLCs and adaptor-signature swaps let two chains trade without a middleman.">
<link rel="canonical" href="https://testnethub.com/swaps">
<meta name="robots" content="index, follow">
<meta name="referrer" content="no-referrer">
<meta name="theme-color" content="#14161b">
<meta name="author" content="Tech1k">
<meta property="og:type" content="website">
<meta property="og:site_name" content="TestnetHub">
<meta property="og:title" content="How atomic swaps work with TestnetSwap · TestnetHub">
<meta property="og:description" content="Try non-custodial atomic swaps between testnet coins with TestnetSwap, and learn how HTLCs and adaptor-signature swaps let two chains trade without a middleman.">
<meta property="og:url" content="https://testnethub.com/swaps">
<meta property="og:image" content="https://testnethub.com/assets/og.png?v=2">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="TestnetHub: learn crypto with fake coins and real protocols">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="How atomic swaps work with TestnetSwap · TestnetHub">
<meta name="twitter:description" content="Try non-custodial atomic swaps between testnet coins with TestnetSwap, and learn how HTLCs and adaptor-signature swaps let two chains trade without a middleman.">
<meta name="twitter:image" content="https://testnethub.com/assets/og.png?v=2">
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/assets/icon-192.png">
<link rel="manifest" href="/manifest.webmanifest">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; connect-src 'self'; manifest-src 'self'; object-src 'none'; base-uri 'none'; form-action 'none'">
<script src="/assets/theme-init.js?v=1"></script>
<link rel="stylesheet" href="/assets/style.css?v=5">
<script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://testnethub.com/#org","name":"TestnetHub","url":"https://testnethub.com/","logo":"https://testnethub.com/favicon.svg"},{"@type":"WebSite","@id":"https://testnethub.com/#website","name":"TestnetHub","url":"https://testnethub.com/","publisher":{"@id":"https://testnethub.com/#org"},"description":"Learn the Bitcoin, Litecoin, and Monero testnets with free coins and real protocols."}]}</script>
</head>
<body>
<a class="skip-link" href="#main">Skip to content</a>
<span id="copy-status" role="status" class="visually-hidden"></span>
<nav class="navbar">
<a href="/" class="brand" aria-label="TestnetHub home">
<svg class="brand-logo" viewBox="0 0 64 64" width="26" height="26" aria-hidden="true"><rect class="mark-bg" width="64" height="64" rx="14"/><g stroke="currentColor" stroke-width="3.4" stroke-linecap="round"><line x1="32" y1="32" x2="19" y2="19"/><line x1="32" y1="32" x2="45" y2="19"/><line x1="32" y1="32" x2="19" y2="45"/><line x1="32" y1="32" x2="45" y2="45"/></g><g fill="currentColor"><circle cx="19" cy="19" r="5"/><circle cx="45" cy="19" r="5"/><circle cx="19" cy="45" r="5"/><circle cx="45" cy="45" r="5"/><circle cx="32" cy="32" r="6.5"/></g></svg>
<span class="brand-name">Testnet<b>Hub</b></span>
</a>
<input type="checkbox" class="menu-toggle" id="menu-toggle" aria-label="Open the navigation menu" aria-controls="nav-links">
<label for="menu-toggle" class="hamburger"><div></div><div></div><div></div></label>
<div class="nav-links" id="nav-links">
<a href="/">Home</a>
<a href="/testnets">Testnets</a>
<a href="/guides">Guides</a>
<a href="/tools">Tools</a>
<a href="/status">Status</a>
<a href="/donate">Donate</a>
<button class="theme-toggle" id="theme-toggle" type="button" aria-label="Toggle light / dark theme" title="Toggle theme"><svg class="ico ico-sun" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg><svg class="ico ico-moon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg></button>
</div>
</nav>
<main id="main" class="filled" tabindex="-1">
<div class="card hero">
<div class="card-body">
<h1><span class="grad">Swap testnet coins</span></h1>
<p class="lede">An atomic swap trades one coin for another across two different blockchains with no custodian. It either completes fully or safely refunds both sides. TestnetSwap does tLTC ↔ tBTC, plus experimental tXMR/sXMR → tBTC swaps.</p>
<div class="hero-cta">
<a class="formbtn ext" href="https://testnetswap.com" target="_blank" rel="noopener">Open TestnetSwap</a>
<a class="formbtn ghost" href="/faucet">Get coins first</a>
</div>
</div>
</div>
<div class="card"><div class="card-body prose">
<h2 id="what">What is an atomic swap? <a class="anchor" tabindex="-1" href="#what" aria-hidden="true">#</a></h2>
<p>Normally, trading one coin for another means trusting an exchange to hold your funds. An <strong>atomic swap</strong> removes the middleman: two people trade directly across chains, and cryptography guarantees the trade is all-or-nothing. Either both sides get paid, or both get their original coins back. <strong>Nobody ever holds your coins.</strong></p>
<h2 id="htlc">How it works (HTLC) <a class="anchor" tabindex="-1" href="#htlc" aria-hidden="true">#</a></h2>
<p>For Bitcoin and Litecoin, the trick is a <strong>hash time-locked contract (HTLC)</strong>: coins are locked behind a secret, with a refund deadline if the swap stalls.</p>
</div></div>
<div class="card"><h2 class="card-header">The four phases</h2><div class="card-body"><div class="steps">
<div class="step"><span class="n"></span><div><h3>Setup</h3><p>You and the maker agree on the pair, amount, and two refund deadlines, over a relay that only passes messages and holds no keys or coins.</p></div></div>
<div class="step"><span class="n"></span><div><h3>You lock</h3><p>Your wallet locks your coins in a contract on the chain you're sending from. Only you can refund it, and only after your deadline.</p></div></div>
<div class="step"><span class="n"></span><div><h3>They lock</h3><p>The maker sees your funded contract and locks the other coin on the receiving chain, behind the same secret, with a shorter deadline.</p></div></div>
<div class="step"><span class="n"></span><div><h3>You claim</h3><p>You claim the maker's coins by revealing the secret. That same secret lets the maker claim yours. The swap completes atomically.</p></div></div>
</div></div></div>
<div class="callout tip">
<p class="co-title">The worst case is safe</p>
<p>If anything stalls, you reclaim exactly what you locked (minus network fees) after your deadline. A maker can never take your coins, because they can't claim yours without revealing the secret that lets you claim theirs.</p>
</div>
<div class="card"><div class="card-body prose">
<h2 id="monero">Monero swaps are different <a class="anchor" tabindex="-1" href="#monero" aria-hidden="true">#</a></h2>
<p>Monero can't use the same HTLC scripts, so tXMR/sXMR → tBTC swaps use a cross-chain <strong>adaptor-signature</strong> protocol instead. The non-custodial, all-or-nothing guarantee is the same, but this path is still <strong>experimental and in active development</strong>, so expect it to be slower and less polished than tLTC↔tBTC. See the <a href="/monero">Monero guide</a> for why Monero behaves differently.</p>
<h2 id="try">Try it <a class="anchor" tabindex="-1" href="#try" aria-hidden="true">#</a></h2>
<ol>
<li>Get both testnet coins from the <a href="/faucet">faucet</a>.</li>
<li>Open <a class="ext" href="https://testnetswap.com" target="_blank" rel="noopener">TestnetSwap</a>.</li>
<li>Pick the pair and amount.</li>
<li>Your wallet locks, the maker locks, and you claim. Done. Watch each step confirm on the <a href="/explorer">explorer</a>.</li>
</ol>
<div class="callout tip">
<p class="co-title">Also built into your wallet</p>
<p>The same swap is available natively inside <a class="ext" href="https://testnetwallet.net" target="_blank" rel="noopener">TestnetWallet</a>, so you can trade coins without leaving the wallet. It runs the identical non-custodial swap under the hood.</p>
</div>
</div></div>
<div class="warnbox">
<span class="wb-ico" aria-hidden="true">⚠️</span>
<div class="wb-body">
<h3>Testnet coins are fake money</h3>
<ul>
<li>They have no market value, so never buy or sell them.</li>
<li>Never use a real seed phrase or import a real wallet on testnet.</li>
<li>Never send mainnet BTC, LTC, or XMR to a testnet address.</li>
</ul>
</div>
</div>
<div class="pagenav">
<a href="/explorer"><div class="pn-dir">← Previous</div><div class="pn-t">Read a block explorer</div></a>
<a class="pn-next" href="/guides"><div class="pn-dir">Next →</div><div class="pn-t">All guides</div></a>
</div>
</main>
<footer>
<div class="foot-inner">
<a class="ext" href="https://cypherfaucet.com" target="_blank" rel="noopener">Faucet</a>
<a class="ext" href="https://testnetpool.com" target="_blank" rel="noopener">Pool</a>
<a class="ext" href="https://testnetwallet.net" target="_blank" rel="noopener">Wallet</a>
<a class="ext" href="https://testnetscan.com" target="_blank" rel="noopener">Explorer</a>
<a class="ext" href="https://testnetswap.com" target="_blank" rel="noopener">Swap</a>
<a href="/guides">Guides</a>
<a href="/status">Status</a>
<a href="/donate">Donate</a>
<span class="faint">·</span>
<span>Part of the <a class="ext" href="https://tech1k.com" target="_blank" rel="noopener">Tech1k</a> testnet ecosystem</span>
<span class="faint">·</span>
<a class="ext" href="https://github.com/Tech1k/testnethub.com" target="_blank" rel="noopener">Source</a>
<a class="ext" href="https://github.com/Tech1k/testnethub.com/blob/HEAD/LICENSE" target="_blank" rel="noopener">Code AGPL-3.0</a>
<a class="ext" href="https://github.com/Tech1k/testnethub.com/blob/HEAD/LICENSE-CONTENT" target="_blank" rel="noopener">Content CC-BY-SA-4.0</a>
<span class="faint">· testnet only · coins have no value</span>
</div>
</footer>
</body>
</html>