Skip to main content

Under the Hood

BasicSwap can be best understood as the decentralized version of the SWIFT messaging network, facilitating the exchange of messages between trading peers through the decentralized SMSG network. This communication layer enables users to execute coin swaps directly, without any central party involvement.

Importantly, BasicSwap itself does not conduct the actual swapping of coins. This process occurs exclusively on-chain via atomic swaps executed directly on the respective blockchains of the cryptocurrencies being exchanged.

BasicSwap's primary function is to help users establish a secure communication channels between each other, enabling them to exchange the cryptographic information necessary for atomic swaps and to broadcast their offers publicly without relying on intermediaries.

BasicSwap is a Messaging Protocol + Atomic Swaps

BasicSwap combines decentralized messaging with atomic swap protocols to create a fully decentralized exchange without intermediaries.

Atomic Swaps

BasicSwap implements two distinct atomic swap protocols: HTLC ('Secret Hash') and PTLC ('Adaptor Signature'). These on-chain mechanisms enable cryptocurrency exchanges without requiring trusted third parties.

HTLC Protocol (Secret Hash)

Uses hashed time-locked contracts to guarantee that both parties fulfill their obligations or the transaction is automatically reversed.

PTLC Protocol (Adaptor Sigs)

Employs adaptor signatures to enable atomic swaps with unscriptable coins like Monero while providing better privacy.

Technical Implementation

Both protocols are open-source developments from the broader cryptocurrency community and their scope is intentionally narrow — they do not match orders or provide a complete DEX framework. Instead, they focus exclusively on secure, trustless execution of exchanges directly on the respective blockchains without intermediaries.

The Messaging Layer Requirement

Due to their focused scope, atomic swap protocols require a complementary decentralized messaging infrastructure to relay critical information between participants. This communication layer is essential because:

  • Blockchains operate independently and cannot directly communicate with each other
  • Participants need to exchange cryptographic proofs and transaction details
  • Each step in the swap process requires confirmation data from the counterparty

SecureMessaging (SMSG)

BasicSwap utilizes the SecureMessaging (SMSG) network—an open-source, decentralized messaging protocol similar to BitMessage—to facilitate the exchange of cryptographic data necessary for atomic swaps. This communication infrastructure enables direct peer-to-peer information sharing without requiring intermediaries.

SMSG Architecture

Node architecture: All BasicSwap users automatically operate as nodes within the SMSG network.
End-to-end encryption: All messages are encrypted on the user's local device before transmission.
Decentralized broadcasting: Encrypted messages are distributed throughout the network.
Collective validation: All nodes participate in relaying and validating messages to ensure authenticity.

This architecture provides robust protection for users' financial information against unauthorized access while maintaining a completely decentralized structure.

Decentralized Functionality

The SMSG network enables BasicSwap to offer functionality beyond what atomic swaps alone can provide:

  • Maintaining a decentralized order book
  • Automating complex swap procedures from the user's perspective
  • Facilitating secure communication between independent blockchain networks

In practice, BasicSwap functions as a decentralized alternative to SWIFT—providing a messaging protocol that enables direct peer-to-peer communication for executing atomic swaps using official coin cores (Bitcoin Core, Litecoin Core, etc.).

It's important to understand that BasicSwap itself does not process, initiate, or execute the actual swaps. Its role is strictly limited to enabling secure communication between trading parties and simplifying the complex process of performing atomic swaps across different blockchains.

Adaptor Signatures

While many DEX platforms rely on smart contracts or HTLC atomic swaps, these technologies present compatibility issues with certain cryptocurrencies like Bitcoin or Monero. BasicSwap overcomes these limitations through the implementation of adaptor signatures.

Advanced Cryptographic Technique

Adaptor signatures are an off-chain form of smart contract that provide the flexibility needed to execute atomic swaps with non-programmable cryptocurrencies like Monero.

They also provide more privacy than traditional HTLC atomic swaps by not inscribing an identical hash at a similar time on both participating blockchains of a swap.

info

Learn more about Adaptor Signatures: Whitepaper - OtVES Signatures