• Stars
    star
    246
  • Rank 164,726 (Top 4 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

interBTC: Bitcoin Anywhere

interBTC

A modular and programmable layer for Bitcoin and the multi-chain ecosystem.
Explore the docs ยป

Report Bug ยท Request Feature

Table of Contents

About the Project

The interBTC project is a modular and programmable layer to bring Bitcoin to the multi-chain ecosystem. It includes:

Built with

The interBTC project is built with:

Structure

Runtime

The Substrate runtime configuration is in the parachain folder.

  • Interlay: The Interlay runtime configuration.
  • Kintsugi: The Kintsugi canary network runtime configuration.
  • Common: Common runtime configuration for Interlay and Kintsugi.

Test networks are build from the mainnet runtimes and have no dedicated runtimes.

Crates

The chain 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.
  • clients-info: Stores current and future interbtc-client software releases.
  • collator-selection: Decentralized sequencers (collators) for the chain.
  • currency Handles currencies (e.g. DOT/KSM/IBTC).
  • democracy: Optimistic governance fork of pallet-democracy.
  • dex-general: Uniswap v2-style AMM implementation.
  • dex-stable: Curve v1-style AMM implementation.
  • dex-swap-router: Swap router for the AMMs.
  • escrow: Rust implementation of Curve's Voting Escrow contract.
  • farming: Farming module for AMM liquidity mining.
  • fee: Participant reward calculation and distribution.
  • issue: Handles issuing of interBTC for BTC on Bitcoin.
  • loans: Compound v2-style money market implementation.
  • multi-transaction-payment: Pay assets other than the native one for transaction fees.
  • 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.
  • 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.
  • tx-pause: Handles pausing of transactions.
  • 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

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.

Development node

Running a development can be achieved without compiling the node with docker and instant-seal. Replace the release version with one of the available tags:

docker run --network=host interlayhq/interbtc:RELEASE_TAG --dev --instant-seal
#  Example
docker run --network=host interlayhq/interbtc:1.25.0-rc5 --dev --instant-seal

Test Coverage

Test coverage reports available under docs/testcoverage.html

Javascript / Typescript

Either use the polkadot.js API or checkout interbtc-api for a TypeScript SDK.

Contributing

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

License

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

Contact

Linktree: Linktree

Website: interlay.io

Twitter: @interlayHQ

Discord: Discord

Telegram: Telegram

Acknowledgements

This project is supported by a Web3 Foundation grant and the Substrate Builders Program.

More Repositories

1

interbtc-clients

interBTC Clients | Vault, Oracle, Faucet
Rust
51
star
2

btc-relay-solidity

Bitcoin Light Client on Ethereum
TypeScript
40
star
3

interbtc-ui

Kintsugi and Interlay App - BTC DeFi
TypeScript
32
star
4

interbtc-api

interBTC TypeScript SDK
TypeScript
26
star
5

interbtc-spec

interBTC specification for a trust-minimized Bitcoin to Polkadot (and beyond) bridge
Makefile
17
star
6

compressed-inclusion-proofs

TxChain: Efficient Cryptocurrency Light Clients via Contingent Transaction Aggregation
JavaScript
14
star
7

xopts

Zero Trust Bitcoin Options on Ethereum
TypeScript
12
star
8

polkabtc-ui

interBTC App - Mint 1:1 backed BTC on Polkadot and Kusama
TypeScript
12
star
9

monetary

A library to handle currencies and money. Targeted at Dapps and other blockchain applications.
TypeScript
7
star
10

interlay.github.io

Interlay documentation for users, vaults, developers and everyone else.
Shell
7
star
11

metamask-snap-bitcoin

Metamask Bitcoin Plugin
HTML
7
star
12

esplora-btc-api

Blockstream Esplora Client (Typescript)
Makefile
6
star
13

bots

TypeScript bots for the Kintsugi and Interlay networks
TypeScript
6
star
14

subxt-gen

Generate client-side stubs from Substrate RuntimeMetadata for substrate-subxt.
Rust
6
star
15

interbtc-squid

Subquid GraphQL schema and indexer for the Interlay and Kintsugi networks
TypeScript
4
star
16

brc-21-experiment

BRC-21 standard for cross-chain BRC-20 tokens
4
star
17

collateralization-analysis

Python
3
star
18

xopts-ui

UI for Zero Trust BTC Options
CSS
2
star
19

interbtc-types

TypeScript types for Kintsugi and Interlay networks
TypeScript
1
star
20

whitepapers

Collection of papers on interBTC and Kintsugi
1
star
21

archive-interlay.github.io

CSS
1
star
22

brc42-experiment

BRC-42 standard for cross-chain BRC-20 tokens
1
star
23

polkabtc-stats

PolkaBTC Stats
PLpgSQL
1
star
24

subxt-workshop

Subxt Workshop for Polkadot Decoded 2022
Rust
1
star
25

ui

TypeScript
1
star