Skip to content

omariosman/mint-tbtc-threshold

Repository files navigation

tBTC Mint/Redeem Example

This is a TypeScript project that uses the tBTC Bitcoin/Ethereum bridge to mint and redeem tBTC tokens.

This repository demonstrates an example workflow to mint and redeem tBTC tokens.

How to Use the Repo?

1. Clone/Fork the Repository

git clone [email protected]:omariosman/mint-tbtc-threshold.git

2. Install Dependencies

npm install

Minting tBTC

  1. Add a .env file with the following value:
PRIVATE_KEY=<your-ethereum-private-key>
BTC_RECOVERY_ADDRESS=<your-btc-segwit-address>

The PRIVATE_KEY is the private key of the ethereum account to which tBTC will be sent

The BTC_RECOVERY_ADDRESS will be used to recover your tokens back in case minting tBTC failed for any reason

  1. Run the src/getBTCAddr script using this command
npm run getBTCAddr

This script will log a Bitcoin address on the terminal, send your BTC to this address

  1. Run the src/mintTBTC script using this command
npm run mintTBTC

Redeeming tBTC (Get your BTC back)

  1. Add a .env file with the following value:
REDEEM_BTC_ADRESS=<your-btc-segwit-addr>

This is the address to which the btc will sent

  1. Run the src/redeemTBTC script using this command: npm run redeemTBTC

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published