Functioning, minimal-viable binaries and libraries to perform a trustless, p2p Maxwell-Belcher Coinswap Protocol.
Coinswap v0.1.0 marketplace is now live on Custom Signet. Check it out here (Tor Browser required).
This library is currently under beta development and is in an experimental stage. There are known and unknown bugs. Mainnet use is strictly NOT recommended.
Coinswap is a decentralized atomic swap protocol that enables trustless swaps of Bitcoin UTXOs through a decentralized, Sybil-resistant marketplace.
Existing atomic swap solutions are centralized, rely on large swap servers, and have service providers as single points of failure for censorship and privacy attacks. This project implements atomic swaps via a decentralized market-based protocol.
The project builds on Chris Belcher's teleport-transactions and has significantly matured with complete protocol handling, functional testing, Sybil resistance, and command-line applications.
Anyone can become a swap service provider (Maker) by running makerd
to earn fees. Takers use the taker
app to swap with multiple makers, routing through various makers for privacy. The system uses a smart-client-dumb-server philosophy with minimal server requirements, allowing any home node operator to run a maker.
The protocol employs fidelity bonds for Sybil and DoS resistance. Takers coordinate swaps and handle recovery; makers respond to queries. All communication occurs over Tor.
For technical details, see the Coinswap Protocol Specification.
sudo apt install build-essential automake libtool
Tor Installation: Required for all operations. Download from torproject.org for your OS. Bitcoin Core automatically detects Tor and creates anonymous services. See the Tor guide for configuration details.
Bitcoin Core: Requires fully synced, non-pruned node with RPC access on Custom Signet with -txindex
enabled. Follow the bitcoind setup guide.
git clone https://github.com/citadel-tech/coinswap.git
cd coinswap
cargo build --release
Install the necessary binaries in your system:
sudo install ./target/release/taker /usr/local/bin/
sudo install ./target/release/makerd /usr/local/bin/
sudo install ./target/release/maker-cli /usr/local/bin/
makerd --help
maker-cli --help
taker --help
# Test connection to market
taker fetch-offers
makerd
: Server daemon for swap providers. Requires continuous uptime and Bitcoin Core RPC connection. Demo
maker-cli
: RPC controller for makerd
. Manage server, access wallet, view swap statistics. Demo
taker
: Swap client acting as a Bitcoin wallet with swap capability. Demo
Always stop makerd
with maker-cli stop
to ensure wallet data integrity. Avoid using ctrl+c
.
Extensive functional testing simulates various protocol edge cases:
cargo test --features=integration-test -- --nocapture
The Test Framework spawns toy marketplaces in Bitcoin regtest to test swap scenarios. Each test in tests covers different edge cases. Start with standard_swap to understand programmatic simulation.
- Browse issues, especially
good first issue
tags - Review open PRs
- Search for
TODO
s in the codebase - Read the docs
The repo contains pre-commit githooks to do auto-linting before commits. Set up the pre-commit hook by running:
ln -s ../../git_hooks/pre-commit .git/hooks/pre-commit
Dev community: Discord
Dev discussions predominantly happen via FOSS best practices, and by using Github as the major community forum.
The Issues, PRs and Discussions are where all the hard lifting is happening.