comit-network / comit-rs

Reference implementation of COMIT, an open protocol facilitating trustless cross-blockchain applications.
GNU General Public License v3.0
191 stars 33 forks source link
atomic-swaps comit cryptocurrencies decentralized-applications hacktoberfest rust

Archive note

This repository has been archived because it is not actively maintained. For more details about why, see the blog post about the project's closing.

However, this doesn't mean that we've stopped on working on COMIT! To get on top of what is happening currently, join our Matrix channel or checkout some of our other repositories.

Old readme

COMIT logo


COMIT is an open protocol facilitating cross-blockchain applications. For example, with COMIT you can exchange Bitcoin for Ether or any ERC20 token directly with another person.

This repository contains the reference implementation of the protocol written in Rust.

GitHub Action CI on dev Safety Dance Bors enabled License: GPL v3 Matrix chat

comit-rs

The Rust reference implementation of the COMIT protocol (comit-rs) implements atomic swaps using constructs like Hash Time-Locked Contracts (HTLCs) to keep your funds safe at any time.

Structure

This repository is a cargo workspace:

cnd and nectar are released as binaries.

The comit library will be released to crates.io once its interface stabilizes.

Setup build environment

All you need is ~love~ Rust: curl https://sh.rustup.rs -sSf | sh

Build binaries

Run binaries

Both, cnd and nectar require a connection to a Bitcoin and an Ethereum full node. All config file options have sensible defaults but can also be overridden. Run cnd dump-config or nectar dump-config for more information.

Setup testing/dev environment

  1. Install docker,
  2. Install node (check the version required in tests/package.json) & yarn,
  3. Run make in the root folder of the repository, this will install various crates & tools such as clippy.

Testing

To run individual end-to-end tests, use yarn inside the tests folder:

Cnd over Tor

If you would like to maintain anonymity while using cnd for atomic swaps we support running cnd over Tor. You will need to configure an onion service (previously hidden service), virtual port can be anything but cnd expects the local port to be 9939.

HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 9939 127.0.0.1:9939

After starting Tor for the first time get the onion service address from your local file system (e.g. /var/lib/tor/hidden_service/hostname) and add it to your cnd config file.

[network]
listen = ["/onion3/vww6ybal4bd7szmgncyruucpgfkqahzddi37ktceo3ah7ngmcopnpyyd:9939"]

All cnd traffic will now be routed over the Tor network.

Contributing

Contributions are welcome, please visit CONTRIBUTING for more details.

If you have any question please reach out to the team in our Matrix channel!

License

This project is licensed under the terms of the GNU GENERAL PUBLIC LICENSE v3.