How it works
An adaptor-signature atomic swap between Monero and Epic Cash (a Mimblewimble chain). Neither chain has scripts that can see the other, so the link between them is one secret: your half of the Monero spend key. Publishing the Epic claim that pays you reveals it, and nothing else does.
The keys
- Your browser makes a fresh secret
s_ufor this swap. The market maker makess_m. Neither half leaves its owner. - Each side proves its half with a cross-curve discrete-log equality proof (sigma_fun): the same secret behind a point on ed25519 (Monero) and on secp256k1 (Epic), with a proof of knowledge. Your browser checks the maker's proof itself.
- The Monero swap address is worked out in your browser: spend key
S_u + S_mon ed25519, plus a per-swap view key from the maker. Spending from it needs both halves; no single party, including the maker, can. - The maker holds the view key, so it can see what arrives at the swap address. Nobody else can.
Signed before anything moves
Three Epic transactions are agreed before any coin is locked. Your browser verifies each one (values, fees, heights, and that the refund and late claim spend exactly the locked output):
s_m from the kernel and holds the whole Monero key.Step by step
- Quote and keys. You pick an amount; the price is read from NonKYC's order book on demand. Key halves and proofs are exchanged and checked.
- Your wallet accepts the EPIC. The incoming payment is set up with your Epic wallet over Epicbox (or sealed to an
epic1address). It shows as waiting until the swap ends. Nothing is paid yet. - The maker locks first. Your browser looks up the lock's kernel and the locked output on public Epic nodes itself. The payment address appears once the lock is 1 block deep, unspent, and at least 120 blocks before H1.
- You pay XMR to the swap address, from any wallet, in one payment.
- Confirmations. The maker finds the payment with the view key and waits for 3 Monero confirmations up to $25, 6 up to $100, 10 up to $500 and 20 above (20 for every size after a deep reorg).
- The claim. The maker signs the claim that pays you, as an adaptor under your key half, and from then on never publishes the refund (rule 1). Your browser verifies the adaptor signature.
- Your browser releases the EPIC. It re-checks that the lock is at least 10 blocks deep, unspent, and at least 40 blocks before H1, completes the claim with
s_u, and publishes it to public Epic nodes only, never to the maker directly (rule 2). - The maker takes the XMR. The published claim reveals
s_uto the maker, who can now spend from the swap address. That is the only way it can.
If something goes wrong
| What happens | Outcome |
|---|---|
| You never pay | The maker publishes the refund at H1. You lose nothing. |
| You pay after the maker stopped accepting (too close to H1) | No claim is offered; the maker refunds at H1, which hands your browser s_m: you hold the whole Monero key and take your XMR back. |
| Your page closes after paying | The swap waits for you. Open the site on any device, enter the recovery code, and the page finishes the claim (it has ~24 h). |
| The maker goes offline after you paid | No claim arrives; at H2 your browser publishes the late claim and the EPIC is yours. |
| The maker reorgs Epic to undo its lock after you paid | The residual risk. It needs a deliberate reorg deeper than the lock's depth when you paid, i.e. hashrate. Your XMR would be stuck at the swap address (the maker can't take it either). It is why the lock must be on chain before the address appears. |
Your recovery code
A 16-character code from your browser's random generator. Your swap state (key half included) is encrypted with AES-GCM under SHA-256("epic2xmr/backup-key/" + code) and stored at the maker's canister under the tag SHA-256("epic2xmr/backup-tag/" + code). The maker stores ciphertext it can't open; the code never leaves your device. You can also save the backup as a file.
What each party receives
- The maker's canister: your public key halves and proofs, the XMR amount, progress notes and automatic error reports from this page (device and browser type, steps reached, errors, and your wallet's relay domain, not its address), the encrypted backup, and a problem report if you send one. Through the view key it sees the payment arriving at the swap address. It does not receive your Epic address.
- The Epicbox relay (or BT Labs' relay for an
epic1address) carries the wallet messages to your Epic address. - Public Epic nodes answer your browser's look-ups of the lock and publish your claim.
- On chain: Monero shows a payment to a one-time address; Epic shows Mimblewimble kernels and commitments with no addresses or amounts.
Where it runs
The maker is a canister on the Internet Computer: its code decides when to lock, sign and refund, and the page you are reading is served and certified by that same canister. The swap logic in your browser is a WebAssembly module built from the same Rust code. The code is open source.
Start a swap