Crate farcaster_core
source ·Expand description
Farcaster core library aims to implement in Rust the core principles described in Farcaster RFCs:
- Swap deals: data needed to start a swap with a counter-party
- Swap roles and trade roles: who does what in the protocol
- Transaction templates implementing on-chain behaviours
- Signature and cryptographic utilities
- ECDSA adaptor signatures
- Cross-group discrete logarithm proof system
- Schnorr adaptor signature [work in progress]
Core framework
This library is twofold: providing a flexible framework to add specific blockchain support and implementing these specific blockchains. The framework is accessible in all modules at the root of the crate. The blockchains support are added under the the following modules:
bitcoin
: support for Bitcoin, implementation of theArbitrating
blockchain role.monero
: support for Monero, implementation of theAccordant
blockchain role.swap/btcxmr
: definition of a swap betweenbitcoin
andmonero
implementations.
Adding blockchain support
To add a blockchain implementation you must implements the Aribtrating
or Accordant
role
requirements on your blockchain. That depends on its blockchain on-chain features, see
RFCs for more details.
The protocol is executed with protocol::Alice
and protocol::Bob
structures, each implement
a list of generic functions that allow performing one step in the protocol execution. Adding
support for a chain means having the correct types to run those functions.
For an arbitrating implementation on-chain transactions are required, the trait Transactions
allow defining the set of transaction to build and use during the swap execution.
Features
As default the experimental
feature is enable.
- experimental: enable experimental cryptography, i.e. not battle tested nor peer reviewed, use it at your own risks.
- taproot: enable support for Bitcoin Taproot on-chain scripts as the arbitrating engine method.