About Technology Wallets Governance Academy News Community
Technical Update

First Trustless BTC↔MARS Atomic Swap Completed on Mainnet

April 12, 2026 Marscoin Foundation

Atomic Swap in Electrum-Mars

On April 12, 2026, something quietly remarkable happened. Two computers — one acting as a seller, the other as a buyer — completed a direct trade between Bitcoin and Marscoin on both live mainnets. No exchange was involved. No company held anyone’s funds. No accounts were created, no identities verified. The entire transaction was governed by a cryptographic contract that guaranteed, with mathematical certainty, that either both sides would receive what they were promised or neither side would lose anything.

This was the first successful atomic swap between BTC and MARS. And it was built directly into the Electrum-Mars wallet.

What Actually Happened

The swap began when a maker — the person offering to sell Marscoin — posted an offer on the decentralized order book: 104 MARS in exchange for approximately 0.00003652 BTC. This offer wasn’t listed on any website or exchange. It was broadcast through the network of ElectrumX servers that already support the Marscoin wallet infrastructure, visible to anyone else running Electrum-Mars.

On a separate machine, a taker saw the offer and accepted it. At that moment, the two wallets began a carefully choreographed sequence. The maker’s wallet generated a random 32-byte secret — called a preimage in cryptographic terms — and used its hash to construct a special Bitcoin Script known as a Hash Time-Locked Contract, or HTLC. Think of it as a lockbox with two keys: one key is the secret itself, which lets the intended recipient open it; the other key is a timer, which lets the original sender take everything back if the trade falls through. The maker locked 104 MARS into this kind of lockbox on the Marscoin blockchain.

The taker, seeing the MARS now locked and verifiable on-chain, sent Bitcoin to a matching lockbox on the Bitcoin blockchain — same secret required, different timer. At this point, both currencies sat in their respective lockboxes, and the only way to open either one was to reveal the secret.

The maker’s wallet, monitoring the Bitcoin blockchain via the mempool.space API, detected the incoming BTC payment. It automatically constructed a claim transaction, which — critically — required including the secret in the transaction data. The moment the maker claimed the Bitcoin, the secret became visible to anyone watching the Bitcoin blockchain. The taker’s wallet was watching. It extracted the secret from the Bitcoin transaction’s witness data and immediately used it to unlock the MARS lockbox on the Marscoin chain.

104 MARS arrived in the taker’s wallet. 0.00003652 BTC arrived in the maker’s Bitcoin wallet. Neither party had to trust the other, and at no point did any third party control either person’s funds.

Why This Matters for Marscoin

Until this week, there were essentially two ways to acquire Marscoin. You could create an account on LBank, the centralized exchange that lists the MARS/USDC trading pair, go through their verification process, deposit stablecoins, and place an order. Or you could find someone willing to trade over-the-counter via the Marscoin Discord community and simply trust them to follow through. Both methods work, but both require trusting someone — an exchange that holds your funds during the trade, or a stranger on the internet.

Atomic swaps eliminate that trust requirement entirely. The mathematics of the HTLC contract enforce honest behavior. If the maker tries to take the Bitcoin without delivering the Marscoin, the taker simply waits four hours and reclaims their BTC through the time-lock refund path. If the taker never sends Bitcoin at all, the maker reclaims their MARS after eight hours. There is no scenario where one party ends up with both currencies. The Academy deep dive on atomic swaps explains each of these safety mechanisms in detail.

This property — trustlessness — isn’t merely a convenience improvement over centralized exchanges. It’s architecturally essential for Marscoin’s long-term mission. A Mars colony operating under a 4 to 24 minute communication delay with Earth cannot rely on centralized exchanges headquartered on another planet. The financial infrastructure must work peer-to-peer, settlement must be final without third-party confirmation, and both parties must be protected by protocol rather than policy. Atomic swaps are that protocol.

The Road to Getting It Right

The successful swap on April 12 was not the first attempt. The day before, a test swap stalled when the maker’s wallet failed to progress — a bug in how the Bitcoin HTLC address was communicated between the two wallets. The taker’s Bitcoin sat locked in the HTLC for several hours until the timelock expired, at which point a refund transaction returned the funds to an external Bitcoin wallet (an Exodus wallet, in this case). That refund test was itself valuable: it proved that the safety net works. Even when the happy path breaks, nobody loses money.

The April 12 swap encountered its own challenges. Marscoin miners happened to be producing empty blocks for roughly nine hours — a mining infrastructure issue unrelated to the swap system — which meant the MARS lockbox transaction sat in the mempool far longer than the expected two minutes. The swap engine, designed around the assumption that Marscoin blocks confirm within minutes, initially treated the delay as an expiration and tried to abort. A fix was applied mid-test, and the swap completed successfully once the transaction finally confirmed.

These are the kinds of rough edges you’d expect from software making its first contact with real-world conditions. The technical reference documents every bug encountered and fixed during development, with commit references — a transparency practice that reflects the project’s open-source ethos.

How to Try It

The atomic swap feature is built into Electrum-Mars version 4.3.2.0+mars. If you already use the wallet, look for the Atomic Swap tab. If you’re new, the getting started guide covers wallet setup, and the atomic swap Academy article walks through the trading process step by step — both for sellers (makers) who offer MARS in exchange for BTC, and for buyers (takers) who accept those offers.

There’s also an Auto-Maker feature for more experienced users who want to provide liquidity passively. It connects to a price feed, applies a configurable spread, and automatically posts and manages swap offers — turning any Electrum-Mars wallet into a miniature decentralized exchange.

A few honest caveats: the system is early. It works, but it’s been tested with small amounts between known parties. Concurrent swaps (multiple trades running simultaneously) haven’t been stress-tested yet. The order book doesn’t yet prevent two people from accepting the same offer at the same time. And the wallet currently relies on mempool.space for Bitcoin chain data, rather than connecting to a user’s own Bitcoin node. All of these are documented limitations with clear paths to improvement.

Start small. Back up your wallet. And know that the refund timelock is always there — the mathematical guarantee that your funds come home if anything goes wrong.

What Comes Next

The immediate priorities are reliability and resilience: supporting concurrent swaps, adding offer reservation to prevent race conditions, and allowing users to connect their own Bitcoin node instead of depending on a third-party API. Further out, a transition to Taproot-based adaptor signatures would make swaps more efficient and more private — hiding the HTLC mechanics inside a standard-looking transaction.

But the fundamental achievement is already here. Two people, two blockchains, zero trust required, and a clean exchange of value governed entirely by cryptography. It’s exactly the kind of infrastructure that a self-sovereign settlement on Mars will need — and it works today, on Earth, with real money.


Atomic swaps are experimental software. The Marscoin Foundation recommends starting with small amounts and maintaining wallet backups. For the full technical specification — including the HTLC script, state machine, threat model, and known limitations — see the technical reference on GitHub. For a practical how-to guide, see Atomic Swaps: Trustless BTC↔MARS Exchange in the Academy.

atomic swap Bitcoin trustless Electrum HTLC mainnet decentralized exchange
Olympus
Olympus Online