• This repository has been archived on 23/Mar/2021
  • Stars
    star
    191
  • Rank 202,877 (Top 4 %)
  • Language
    Rust
  • License
    GNU General Publi...
  • Created over 6 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Reference implementation of COMIT, an open protocol facilitating trustless cross-blockchain applications.

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: a non-custodial COMIT network daemon, designed to be driven by a client with wallets (f.e. Ambrosia)
  • nectar: a custodial COMIT network daemon, designed for automated trades
  • comit: a library implementing primitives of the COMIT protocol like libp2p-protocols, the decentralized orderbook and locking- as well as swap-protocols

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

  • cargo build --release --package cnd
  • cargo build --release --package nectar

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

  • make test is just a wrapper around cargo test --all
  • make e2e will run all the end-to-end tests

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

  • yarn run test: run all tests
  • yarn run test <directory>: run all tests in the directory
  • yarn run test <path to test file>: run all tests in this test file, supports shell glob on the path
  • yarn run fix: run prettier and linter to fix format
  • yarn run check: run tsc (to check validity of TypeScript code) and verify format

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.

More Repositories

1

xmr-btc-swap

Bitcoinโ€“Monero Cross-chain Atomic Swap
Rust
646
star
2

a2l-poc

Proof of concept for the A2L protocol on top of Bitcoin.
Rust
17
star
3

grin-btc-poc

A proof-of-concept implementation of a Grin-Bitcoin atomic swap
Rust
17
star
4

rendezvous-server

Standalone rendezvous server: https://github.com/libp2p/specs/blob/master/rendezvous/README.md
Rust
16
star
5

waves

Workspace for project waves - bringing DeFi to Liquid.
Rust
15
star
6

rust-secp256k1-zkp

C
10
star
7

rust-libp2p-tokio-socks5

Libp2p transport for sending TCP traffic via a SOCKS5 proxy e.g., over Tor network.
Rust
10
star
8

RFCs

Request for Comments (RFCs) for the COMIT network
9
star
9

create-comit-app

Set up a local development environment for COMIT apps with one command.
Rust
9
star
10

thor

Proof of concept of the Generalized Bitcoin-compatible Channel paper on top of Bitcoin
Rust
7
star
11

ping-pong

POC demonstrating rust-libp2p connectivity over the Tor network
Rust
5
star
12

maia

A library for CFDs on Bitcoin which uses DLCs
Rust
4
star
13

baru

Rust
4
star
14

ambrosia

UI for trading in the COMIT network
TypeScript
4
star
15

comit-i

A general-purpose web interface for comit-rs
TypeScript
3
star
16

comit-js-sdk

JavaScript SDK for cnd's HTTP API written in TypeScript
TypeScript
2
star
17

spikes

COMIT research outcomes
2
star
18

rust-libp2p-xtra

An `xtra` Actor for network communication building on top of libp2p-core.
Rust
1
star
19

cross-curve-dleq

Proof of concept implementation of a cross-group DLEQ proof for secp256k1 and ed25519
Rust
1
star
20

rust-libp2p-async-await

Rust
1
star
21

app

Moved to
TypeScript
1
star
22

blockchain-contracts

Host the assembly/script code of blockchain contracts used in the COMIT protocol
Rust
1
star
23

rust-elements-consensus

C++
1
star