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.
git clone [email protected]:omariosman/mint-tbtc-threshold.git
npm install
- 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
- 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
- Run the
src/mintTBTC
script using this command
npm run mintTBTC
- 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
- Run the
src/redeemTBTC
script using this command:npm run redeemTBTC