03 · protocol

Three primitives.
One open protocol.

BasicSwap is a decentralized coordination layer for atomic swaps. It holds no funds and does not process, initiate, or execute swaps on your behalf. It carries the encrypted messages traders use to find each other and agree on terms; settlement happens entirely on the blockchains of the coins being traded.

In that sense it is a SWIFT for cross-chain atomic swaps, except there is no company or operator anyone can compel, censor, or switch off.

What BasicSwap is, and what it is not
what basicswap is

A decentralized messaging protocol that facilitates atomic swaps.

  • An end-to-end encrypted mesh that gossips offers, bids, and lock signatures between peers.
  • A set of open atomic swap protocols (HTLC, OtVES, SwapLock) executed on each coin's own chain.
  • Open source under MIT. Anyone can read, audit, fork, or extend it.
what basicswap is not

Not an exchange. Not a custodian. Not a server.

  • BasicSwap does not initiate, process, or execute swaps. Each chain does that itself.
  • BasicSwap does not hold funds, issue wallets, or generate keys. Core wallets do that.
  • BasicSwap does not run servers or central matching. No operator can pause it.
primitive 01

Adaptor signatures.
Atomicity without a Monero script.

The Bitcoin side of a BTC↔XMR swap has script. The Monero side does not. That asymmetry is what blocked cross-chain atomic swaps for years. One-Time Verifiably Encrypted Signatures (OtVES) fix it.

The signature that redeems the Bitcoin is encrypted under one party's half of the Monero spend key. Broadcasting that spend reveals the half on-chain; combined with the other half, it unlocks the Monero. On Monero, atomicity is pure cryptography. The Bitcoin side still uses ordinary script and timelocks, which the paper calls semi-scriptless.

BasicSwap was the first DEX to implement OtVES for XMR atomic swaps, working since 2020.

Read the BTC↔XMR atomic-swap paper
otves · simplified
01Alice locks her XMR under a key split between both parties.
02Bob locks his BTC, redeemable by Alice with a signature missing a secret.
03Alice redeems the BTC. The chain forces her to reveal the secret.
04Bob reads the secret, completes the Monero key, and claims the XMR.
if anyone walks away → presigned refunds
smsg · message cryptography
key exchange
ECDH (secp256k1)
encryption
AES-256-CBC
auth
HMAC-SHA256
storage
1-hour buckets, 31-day TTL
spam resistance
PoW · on-chain fees
primitive 02

SMSG.
An encrypted message mesh.

SMSG is the secure-messaging layer inside Particl's P2P network. It carries the BasicSwap order book and every step of the swap conversation. End-to-end encrypted, peer-to-peer, with no central matcher to subpoena.

The mesh is many small nodes gossiping. Any node can carry any message. No node is privileged. A bid disappears from the open layer once it's delivered: messages live in time-bucketed storage that ages out after 31 days.

primitive 03

Lightweight node fetching.
No chain to install.

Phones don't run full nodes. So BasicSwap Mobile reads chain state from public Electrum nodes directly. No daemon to install, no 50 GB sync, no explorer dependency. The thin client speaks the same protocol the heavy client does.

For Monero, the same pattern works against public RPC endpoints with view-only proofs. The phone never syncs a chain. The swap's atomicity holds either way; the trade-off is that light mode trusts the node's view of the chain, where a full coin core verifies it first-hand.

electrum · read pattern
// 1. Subscribe to the chain tip
tip  = electrum.blockchain.headers.subscribe()

// 2. Read history + transactions on demand
hist = electrum.blockchain.scripthash.get_history(scripthash)
tx   = electrum.blockchain.transaction.get(txid)

// 3. Track confirmation depth against the tip
confs = tip.height - hist.height + 1

// 4. Light mode trusts the server's view.
//    Run a full coin core to verify first-party.
otves · the swap, message by message

Eight messages.
Then settlement, on chain.

A BasicSwap OtVES swap is a sequence of eight signed messages on the SMSG mesh, plus on-chain transactions. The sequence below traces one XMR ↔ BTC swap, and shows who sends what.

otves method XMR ↔ BTC · adaptor signatures
who's who · each step below is colored by its sender
Alice
taker · sends BTC
SMSG mesh
the gossip layer every message passes through
Bob
maker · sends XMR
01
OfferMessage Bob → mesh
Bob publishes an offer

Bob gossips an OfferMessage onto SMSG: "I will trade 1.25 XMR for 0.052 BTC". The whole mesh now sees it.

02
XmrBidMessage Alice → mesh
Alice bids

Alice spots the offer on her client and broadcasts a bid for it. SMSG carries it to Bob without revealing IP or identity.

03
XmrBidAcceptMessage Bob → mesh
Bob accepts

Bob accepts the bid. Both sides now have the cryptographic material needed to begin the swap.

04
XmrBidLockTxSigsMessage Alice → mesh
Alice sends lock signatures

Alice produces adaptor signatures and presigned refund branches. She sends them through SMSG to Bob.

05
XmrSplitTxMessage Bob → mesh
Bob shares the split tx

Bob shares the Monero split transaction. The XMR funds are locked on chain, but only Alice can spend them with the secret she will reveal.

06
XmrBidLockSpendTxMessage Alice → mesh
Alice publishes the spend tx

Alice publishes the BTC spend transaction. The act of publishing reveals the secret embedded in her adaptor signature.

07
XmrBidLockReleaseMessage Bob → mesh
Bob extracts the secret

Bob extracts the revealed secret from the BTC chain and uses it to claim the XMR Alice locked. The swap atomically completes.

08
on-chain settlement Alice ↔ Bob
Settled, on chain

Either both transactions confirm or, if anyone walks away, the presigned refund branches return the funds. No coordinator was ever in the loop.