Code Monkey home page Code Monkey logo

btc-collateral's Introduction

Bitcoin-Collateral

BTC-COLLATERAL offers a collaborative custody service used by a lender and borrower to offer Bitcoin asset as collateral for lending. The borrower deposits their Bitcoin asset in a 2-3 multisig address, having one of the keys, the lender having one of the keys, and the service retaining one of the keys.

The lending terms between the borrower and the lender are tendered to the service. Once signed, the borrower will send assets to the 2-3 multisig address. If the borrower fulfills those terms, the lender and the borrower will sign a 2-3 multisig transaction that transfers those assets back to the borrower, otherwise, they will sign a transaction that forfeits those assets to the lender. If however, there is a dispute and any of them refuses to sign, the service will settle by signing a transaction with the party that fulfills its obligation according to the signed contract.

Status

  • PoC

Required Dependencies

  • Rust v1.74.1
  • Bitcoind

How to Run the Application

  1. Clone the repository and change to the cloned directory

    $ git clone https://github.com/tvpeter/btc-collateral
    $ cd bitcoin-collateral
  2. Rename .env.example to .env

  3. Run and connect Bitcoindto the application

    After installing Bitcoind, update your .env with the nodes RPC username, password and port.

  4. Run initial setup

    $ make init
  5. Run unit and integration tests. Ensure all tests are passing before moving to the next step

    $ cargo test
    Start the server
    $ cargo run

Third-party Services

  1. Mempool.space API for Fees Rates

    https://mempool.space/api/v1/fees/recommended

btc-collateral's People

Contributors

tvpeter avatar jeezman 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.