A trust-minimized bridge from Bitcoin to Polkadot.
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.
This project is currently under active development.
The interBTC runtime allows the creation of interBTC, a fungible token that represents Bitcoin in the Polkadot ecosystem. 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 BTC Parachain. The implementation is based on the interBTC specification.
The interBTC project is built with:
- Alpha - November 2020
- Beta - February 2021
- Rococo - Feburary 2021
- Kusama - TBD
- Polkadot - TBD
The Substrate runtime makes use of various custom pallets that are found in the crates folder.
- 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).
- exchange-rate-oracle: Exchange rate oracle. Integration with external provider pending.
- fee: Participant reward calculation and distribution.
- issue: Handles issuing of interBTC for BTC on Bitcoin.
- 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.
- security: Handles BTC Parachain status and error changes.
- sla: Participant scoring for reward & slashing calculations.
- relay: Handles block submission and theft reporting.
- vault-registry: Handles registration, collateral and liquidation of vaults.
curl https://sh.rustup.rs -sSf | sh
Please also install the following dependencies:
cmakeclang(>=10.0.0)clang-devlibc6-devlibssl-dev
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.
cargo test
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
To run a local development node, use the dev chain spec.
cargo run --release --bin interbtc-standalone -- --devClear the database using the purge-chain command.
cargo run --release --bin interbtc-standalone -- purge-chain --devAdditional CLI usage options are available and may be shown by running cargo run --bin interbtc-standalone -- --help.
To run a local development node, use the dev chain spec.
cargo run --release --bin interbtc-parachain -- --devTo connect with a local relay-chain follow these instructions.
Test coverage reports available under docs/testcoverage.html
The Substrate runtime configuration is in the parachain folder.
When interacting via polkadot{.js} you will need to use our custom types. Please also checkout polkabtc-js for a more complete (strongly-typed) library with bitcoinjs-lib integration.
If you would like to contribute, please file an issue on GitLab or reach out to us.
We are hiring!
(C) Copyright 2020 Interlay Ltd
interBTC is currently licensed under the terms of the Apache License (Version 2.0). See LICENSE
Website: Interlay.io
Twitter: @interlayHQ
Email: contact@interlay.io
This project is supported by a Web3 Foundation grant.
We would also like to thank the following teams for their continuous support:
