GitHub - keep-network/tbtc: Trustlessly tokenized Bitcoin on Ethereum ;)

This repository has been archived. tBTC v1 is no longer actively maintained and has been superseded by tBTC v2. tBTC v2 code is available in the keep-network/tbtc-v2 repository.

tBTC is a trustlessly Bitcoin-backed ERC-20 token.

The goal of the project is to provide a stronger 2-way peg than federated sidechains like Liquid, expanding use cases possible via today’s Bitcoin network, while bringing superior money to other chains.

Getting started

Installation

tBTC contracts are currently published in the NPM Registry as the package @keep-network/tbtc. Packages have versions corresponding to their network:

  • -dev packages contain prerelease packages for the internal Keep testnet.

  • -ropsten packages contain prerelease packages for the Ropsten Ethereum testnet.

Note that only the latest package in a series is expected to reference contracts that have a backing set of signers.

To install the package:

$ npm install @keep-network/tbtc

NOTE: The tbtc package contains an indirect dependency to @summa-tx/relay-sol@2.0.2 package, which downloads one of its sub-dependencies via unathenticated git:// protocol. That protocol is no longer supported by GitHub. This means that in certain situations installation of the package may result in The unauthenticated git protocol on port 9418 is no longer supported error.
As a workaround, we advise changing Git configuration to use https:// protocol instead of git:// by executing:

git config --global url."https://".insteadOf git://

Usage

Once installed, you can use the contracts in the library by importing them:

pragma solidity ^0.5.17;

import "@keep-network/tbtc/contracts/deposit/Deposit.sol";

contract MySystem {
    function checkTerm(address _depositAddress) external {
        uint256 remainingTerm = Deposit(_depositAddress).remainingTerm();
    }
}

Security

Contributing

All contributions are welcome. To report bugs, please create an issue on this repository. To start a discussion, prefer Discord over GitHub issues.

Build

Clone and install dependencies:

git clone https://github.com/keep-network/tbtc
cd tbtc/solidity
npm install

Deploy contracts:

Test

Tests are written in JS using Mocha.

To run the test suite, execute truffle test.

To run specific tests, add .only to the contract block:

contract.only('TBTCToken', function(accounts) {

Lint

npm run sol:lint:fix
npm run js:lint:fix

Documentation

The documentation includes a project overview and rationale, as well as the on-chain specification. Docs should always be updated before or in tandem with code.

Prerequisites

macOS

Install the dependencies via CLI:

+

gem install asciidoctor-pdf --pre
brew install poppler

Build

cd docs

# Generate index.pdf
asciidoctor-pdf index.adoc

License