Giter Site home page Giter Site logo

a491598198 / farcaster-core Goto Github PK

View Code? Open in Web Editor NEW

This project forked from farcaster-project/farcaster-core

1.0 1.0 0.0 1.24 MB

Farcaster Core Library.

Home Page: https://docs.rs/farcaster_core

License: GNU Lesser General Public License v3.0

Shell 0.22% Rust 99.78%

farcaster-core's Introduction

Build Status unsafe forbidden Crates.io Documentation License: LGPL v3 MSRV

Farcaster Core Library

The Farcaster atomic swaps project core library aim to implement in Rust the following functionalities needed to build a swap node:

  • Swap deals (contains all necessary information to start a swap)
  • Swap roles and trade roles (who does what during the swap)
  • Transaction templates implementing on-chain behaviours (arbitration engine, e.g. on Bitcoin blockchain)
  • Signature and cryptographic utilities
    • ECDSA adaptor signatures
    • Cross-group discrete logarithm proof system
    • Schnorr adaptor signature
  • Messages exchanged between farcaster nodes, i.e. the peer-to-peer messages also called protocol messages.

Documentation

Check out the documentation of this library on docs.rs/farcaster_core. All possible improvements, such as adding usage examples and expanding on existing docs would be extremely appreciated.

Core framework

This library's purpose is twofold: providing a flexible framework to add specific blockchain support and implementing these specific blockchains (currently bitcoin and monero). The framework is 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).
  • trade: generic types and utilities for handling the trade setup, e.g. creating a deal.
  • 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 transactions, i.e. the on-chain engine that implements the protocol's game-theoretic mechanism.

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.

Features

The experimental a,d taproot features are enabled by default.

  • experimental: enables experimental cryptography, i.e. not battle tested nor peer reviewed, use it at your own risks.
  • taproot: [work in progress] enables support for Bitcoin Taproot on-chain scripts as the arbitrating engine method.

Adding blockchain support

Check bitcoin, monero, and swap/btcxmr modules to see and example of swap pair. For more details on high level context see the RFCs.

Releases and Changelog

See CHANGELOG.md and RELEASING.md.

About

This work is part of the Farcaster cross-chain atomic swap project, see Farcaster Project.

Licensing

The code in this project is licensed under the LGPL-3.0 License

farcaster-core's People

Contributors

h4sh3d avatar lederstrumpf avatar zkao avatar github-actions[bot] avatar thecharlatan avatar dependabot[bot] avatar leonero avatar kayabanerve avatar nickf12 avatar

Stargazers

A-0810 avatar

Watchers

A-0810 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.