Code Monkey home page Code Monkey logo

interbtc's Introduction

interBTC

interBTC

A trust-minimized bridge from Bitcoin to Anywhere.
Explore the specification »

Report Bug · Request Feature

This repository is hosted on GitHub: https://github.com/interlay/interbtc with a mirror on GitLab and radicle.

Table of Contents

About the Project

The interBTC runtime allows the creation of interBTC, a fungible token that represents Bitcoin on the Interlay network. Interlay in turn is connected to other blockchains via XCM and will be connected to even more blockchians via IBC. Each interBTC is backed by Bitcoin 1:1 and allows redeeming of the equivalent amount of Bitcoins by relying on a collateralized third-party.

The project uses the concept of Cryptocurrency-backed Assets to lock Bitcoin on the Bitcoin blockchain and issue BTC-backed tokens on the Interlay network. The implementation is based on the interBTC specification.

Built with

The interBTC project is built with:

Development Progress

The Substrate runtime makes use of various custom pallets that are found in the crates folder.

  • annuity: Block rewards for stake-to-vote and vaults.
  • bitcoin: Library for Bitcoin type, parsing and verification functions.
  • btc-relay: Stateful SPV client for Bitcoin. Stores Bitcoin main chain, tracks forks, verifies Merkle proofs and validates specific transaction formats.
  • currency Handles currencies used as backing collateral (e.g. DOT/KSM) and issued tokens (e.g. interBTC).
  • democracy: Optimistic governance fork of pallet-democracy.
  • escrow: Rust implementation of Curve's Voting Escrow contract.
  • fee: Participant reward calculation and distribution.
  • issue: Handles issuing of interBTC for BTC on Bitcoin.
  • nomination: Interface for vault nomination.
  • oracle: Trusted providers use this to set exchange rates and Bitcoin fee estimates.
  • redeem: Handles redeeming of interBTC for BTC on Bitcoin.
  • refund: Handles refunds for when a vault receives more BTC than it can cover.
  • replace: Handles replacing vaults.
  • reward: Scalable reward distribution.
  • security: Handles status and error changes.
  • staking: Core logic for vault nomination and slashing.
  • supply: Token minting and inflation.
  • vault-registry: Handles registration, collateral and liquidation of vaults.

Getting started

Prerequisites

curl https://sh.rustup.rs -sSf | sh

Please also install the following dependencies:

  • cmake
  • clang (>=10.0.0)
  • clang-dev
  • libc6-dev
  • libssl-dev

Installation

Building requires a specific rust toolchain and nightly compiler version. The requirements are specified in the ./rust-toolchain.toml override file.

Running rustup show from the root directory of this repo should be enough to set up the toolchain and you can inspect the output to verify that it matches the version specified in the override file.

To build, run:

cargo build

For more detailed development instructions see here.

Testing

cargo test --features runtime-benchmarks

To run with coverage, using cargo-cov:

cargo install cargo-cov

# clean up previous coverage result
cargo cov clean

# test the code
cargo cov test

# open the coverage report
cargo cov report --open

Running - Standalone

To run a local development node, use the dev chain spec.

cargo run --release --bin interbtc-standalone -- --dev

Clear the database using the purge-chain command.

cargo run --release --bin interbtc-standalone -- purge-chain --dev

Additional CLI usage options are available and may be shown by running cargo run --bin interbtc-standalone -- --help.

Running - Parachain

To run a local development node, use the dev chain spec.

cargo run --release --bin interbtc-parachain -- --dev

To connect with a local relay-chain follow these instructions.

Test Coverage

Test coverage reports available under docs/testcoverage.html

Substrate Chain Configuration

The Substrate runtime configuration is in the parachain folder.

Javascript / Typescript

When interacting via polkadot{.js} you will need to use our custom types. Please also checkout interbtc-js for a more complete (strongly-typed) library.

Contributing

If you would like to contribute, please file an issue on GitHub or reach out to us.

License

interBTC is currently licensed under the terms of the Apache License (Version 2.0). See LICENSE

Contact

Website: Interlay.io

Twitter: @interlayHQ

Email: [email protected]

Acknowledgements

This project is supported by a Web3 Foundation grant.

We would also like to thank the following teams for their continuous support:

interbtc's People

Contributors

gregdhill avatar sander2 avatar nud3l avatar alexeizamyatin avatar daniel-savu avatar danhper avatar ns212 avatar theodorebugnet avatar lederstrumpf avatar thecodingrobot avatar jaupe avatar dependabot[bot] avatar

Watchers

James Cloos avatar  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.