interBTC
interBTC: Trustless and open DeFi access for your Bitcoin.
About
The Interlay UI connects the Polkadot ecosystem with Bitcoin. It allows the creation of interBTC and kBTC, a fungible token that represents Bitcoin in the Polkadot and Kusama ecosystem. interBTC and kBTC are backed by Bitcoin 1:1 and allow redeeming of the equivalent amount of Bitcoins by relying on a collateralized third-party called Vaults. In comparison to other bridge constructions (like tBTC, wBTC, or RenVM) anyone can become an intermediary by depositing collateral making interBTC and kBTC the only truly open system.
The bridge itself follows the detailed specification: Explore the specification »
It is implemented as a collection of open-source Substrate modules using Rust: Explore the implementation »
Built with
Kintsugi
You can visit the Kintsugi application at kintsugi.interlay.io.
Testnet
You can visit bridge.interlay.io for the latest testnet.
Quickstart
Make sure you have docker-compose installed locally.
You can run the UI with a local instance of the Interlay or Kintsugi parachain and in combination with Bitcoin regtest or Bitcoin testnet as follows:
Clone this repository and enter into the root folder.
git@gitlab.com:interlay/interbtc-ui.git
cd interbtc-ui
You can configure the application to use certain networks like the official test network as well as a local environment.
Please make use of the .env.*
files to set build variables. The priority of these are defined here.
Local Development
To achieve this, create a file .env.development.local
and fill it with the following contents for either the Interlay or Kintsugi network versions:
Interlay Network
REACT_APP_RELAY_CHAIN_NAME="polkadot"
DOCKER_RELAY_CHAIN_CURRENCY=DOT
Kintsugi Network
REACT_APP_RELAY_CHAIN_NAME="kusama"
DOCKER_RELAY_CHAIN_CURRENCY=KSM
Starting the UI Locally
Note: By default, use regtest for local development.
In one terminal, start the bridge, Bitcoin regtest, Vaults and oracles:
docker-compose --env-file .env.development.local up
On another terminal, start the UI:
yarn install && yarn start
Alternative Local Development Setup
From this repo, run:
rm -rf node_modules
docker-compose down -v
yarn install
docker-compose --env-file .env.regtest up
In another terminal, with the docker-compose services running, in the latest master branch from the lib (https://github.com/interlay/interbtc-api/) run: yarn install && USER_1_URI="//Charlie" yarn initialize
Then start the UI in another terminal:
set -a
source .env.regtest
yarn start-regtest
Connecting to the Interlay Development Environment
Note: This environment might be unstable. It uses the Bitcoin testnet work.
Copy the content of the .env.dev
file to .env.development.local
.
cp .env.dev .env.development.local
Start the UI:
yarn install && yarn start
Connecting to the Interlay Testnetwork
Note: This environment might be unstable. It uses the Bitcoin testnet work.
Copy the content of the .env.testnet
file to .env.development.local
.
cp .env.testnet .env.development.local
Start the UI:
yarn install && yarn start
Test
Test the project.
yarn test
Design System
Visualize the Tailwindcss configuration.
yarn tailwind-config-viewer
Locally run or build Storybook.
yarn storybook # locally run
yarn build-storybook # build
Help
Bitcoin Regtest
Regtest is a local Bitcoin instance that allows you to practically anything including sending transactions, mining blocks, and generating new addresses. For a full overview, head over to the Bitcoin developer documentation.
Sending Transactions
For the issue process, you need to send a transaction. On regtest this can be achieved with:
bitcoin-cli -regtest -rpcwallet=Alice sendtoaddress VAULT_ADDRESS AMOUNT
Mining Blocks
In regtest, blocks are not automatically produced. After you sent a transaction, you need to mine e.g. 1 block:
bitcoin-cli -regtest generatetoaddress 1 $(bitcoin-cli -regtest getnewaddress)
Getting Balances
You can query the balance of your wallet like so:
bitcoin-cli -regtest -rpcwallet=Alice getbalance
Docker
You can hard-reset the docker dependency setup with the following commands:
docker kill $(docker ps -q)
docker rm $(docker ps -a -q)
docker rmi $(docker images -q)
docker volume rm $(docker volume ls -q)
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (git checkout -b yourname/AmazingFeature)
- Commit your Changes (git commit -m 'Add some AmazingFeature')
- Push to the Branch (git push origin yourname/AmazingFeature)
- Open a Pull Request
If you are searching for a place to start or would like to discuss features, reach out to us:
License
(C) Copyright 2022 Interlay Ltd
interbtc-ui is licensed under the terms of the Apache License (Version 2.0). See LICENSE.
Contact
Website: Interlay.io
Twitter: @interlayHQ
Email: contact@interlay.io
Acknowledgements
We would like to thank the following teams for their continuous support: