The Farcaster atomic swaps project core library aim to implement in Rust the following functionnalities needed to build a swap node:
Check out the documentation of this library on docs.rs/farcaster_core. All possible improvments, to add usage examples and to expand on existing docs would be extremely appreciated.
This library is twofold: providing a flexible framework to add specific blockchain support and implementing these specific blockchain (currently bitcoin and monero). The framework split in modules at the root of the crate:
blockchain
: generic types and traits for declaring assets/chains and on-chain behavior.consensus
: encoding and decoding implementation for all types in the crate, used to serialize and deserialize messages exchanged.crypto
: traits and generic types to define cryptographic interactions (wallet capability, commit/reveal scheme, signature and key types, etc).negotiation
: generic types and utilities for handling the negotiation phase, e.g. creating a public offer.protocol
: generic types related to the execution of the protocol and messages exchanged between peers.role
: role definitions (trade and swap) and trait for the generic framework.script
: generic types for transaction data management.swap
: swap related types and swap concrete instances (e.g. bitcoin-monero).transaction
: transaction traits for building and validating the arbitrating set of transaction, e.i. the on-chain engine that guarantees the protocol's game-theory.The blockchain specific support is added under the the following modules:
bitcoin
: support for Bitcoin, implementation of all required traits from the framework, e.g. the Arbitrating
blockchain role.monero
: support for Monero, implementation of all required traits from the framework, e.g. the Accordant
blockchain role.swap/btcxmr
: definition of a swap between bitcoin
and monero
modules with re-export of the majority of generic types with fixed types associated to bitcoin
and monero
.As default the experimental
feature is enable.
Check bitcoin
, monero
, and swap/btcxmr
modules to see and example of swap pair. For more details on high level context see the RFCs.
See CHANGELOG.md and RELEASING.md.
This work is part of the Farcaster cross-chain atomic swap project, see Farcaster Project.
The code in this project is licensed under the LGPL-3.0 License