Threshold Network (merger of Keep Network and NuCypher to form a new network) has now deployed tBTC v2 contracts to mainnet in preparation for tBTC v2 launch. As you might know, tBTC v1 and tBTC v2 have different contract addresses. tBTC v1 will only work with tBTC v1 protocol and tBTC v2 will only work with tBTC v2 protocol.
In preparation for tBTC v2, we have slowly start migrating some liquidity from v1 to v2. tBTC v2 is backed by tBTC v1 1:1 which is still backed by ETH bond put up by signers at 200% of BTC at the time of deposit. This means that tBTC v2 is very safe and secure to mint even though tBTC v2 protocol is not ready yet. For any reason if you want to go back to tBTC v1 from tBTC v2, you can opt to do this at any time. One of the reason you might want to migrate to tBTC v2 is because of the expected liquidity mining rewards for tBTC v2 (This is alpha, shhhhh..).
If you are not aware of the merge , you can find additional details here: https://blog.keep.network/decentralized-collaboration-between-keep-and-nucypher-3501983953af. Since the initial announcement, a significant amount of progress has been made by both the KEEP and NuCypher teams. Kudos to both teams
I am now going to guide you through the various steps required in order to mint tBTC v2 from tBTC v1. In addition, I will also demonstrate how to mint back to tBTC v1 from tBTC v2. All of this is done directly on Etherscan.
Contracts :—
tBTC v1 — 0x8dAEBADE922dF735c38C80C7eBD708Af50815fAa
tBTC v2 — 0x18084fbA666a33d37592fA2633fD49a74DD93a88
Vending Machine v2 — 0x6590DFF6abEd7C077839E8227A4f12Ec90E6D85F
Note: Please triple check the contracts you are going to interact with. Failing to do your due diligence can result in loosing all your funds and there is no way to recover! So be careful !!
Pre-requisites: —
- An installed and unlocked browser MetaMask Extension to interact with Etherscan.
- tBTC v1 to mint tBTC v2.
- tBTC v2 incase you want to mint tBTC v1.
- Some ETH for transaction gas costs.
Steps to Mint tBTC v2 with tBTC v1 : —
- Go to Etherscan and search for tBTC v1 contract 0x8dAEBADE922dF735c38C80C7eBD708Af50815fAa.
- Navigate to ‘Contract’, ‘Write Contract’ section and click ‘Connect to Web3’.
3. You will be prompted with ‘Connect a Wallet’ popup, select ‘MetaMask’ and click ‘OK’ for the warning message. Select the wallet in MetaMask and that should connect your wallet to Etherscan. Once successful, you will see it connected as below.
4. Click ‘approveAndCall’ (function #2) and fill the details as below.
_spender: Vending machine contract address 0x6590DFF6abEd7C077839E8227A4f12Ec90E6D85F.
_amount: Amount of tBTC v1 you want to convert to tBTC v2 in WEI. Go to https://eth-converter.com/ if you are unsure how to convert. I’m converting 0.001 tBTC v1 for this guide, and will enter as ‘1000000000000000’.
_extraData: 0x0.
After entering the details, click ‘Write’.
5. You will now be prompted with MetaMask popup to confirm the transaction. Validate the details/gas costs and click ‘Confirm’.
6. Wait for the transaction to be confirmed. You have now successfully minted tBTC v2.
If you do not see tBTC v2 in MetaMask, do not panic. Add it as custom token using contract address 0x18084fbA666a33d37592fA2633fD49a74DD93a88. Here are steps to do it: ‘https://metamask.zendesk.com/hc/en-us/articles/360015489031-How-to-add-unlisted-tokens-custom-tokens-in-MetaMask’.
Steps to Unmint tBTC v2 and get tBTC v1 : —
There are 2 parts.
PART 1:—
1.1 Go to Etherscan and search for tBTC v2 contract 0x18084fbA666a33d37592fA2633fD49a74DD93a88
1.2 Navigate to ‘Contract’, ‘Write Contract’ section and click ‘Connect to Web3’.
1.3 You will be prompted with ‘Connect a Wallet’ popup, select ‘MetaMask’ and click ‘OK’ for the warning message. Select the wallet in MetaMask and that should connect your wallet to Etherscan. Once successful, you will see it connected as below.
1.4 Click ‘approve’ (function #1) and fill the details as below.
spender: Vending machine contract address 0x6590DFF6abEd7C077839E8227A4f12Ec90E6D85F.
amount: Amount of tBTC v2 you want to convert to tBTC v1 in WEI. Go to https://eth-converter.com/ if you are unsure how to convert. I’m converting 0.001 tBTC v2 for this guide, and will enter as ‘1000000000000000’.
After entering the details, click ‘Write’.
1.5 You will now be prompted with MetaMask popup to confirm the transaction. Validate the details/gas costs and click ‘Confirm’.
1.6 Wait for transaction to be confirmed and you are now done with part 1.
PART 2 : —
2.1 Go to Etherscan and search for Vending Machine contract 0x6590DFF6abEd7C077839E8227A4f12Ec90E6D85F
2.2 Navigate to ‘Contract’, ‘Write Contract’ section and click ‘Connect to Web3’.
2.3 You will be prompted with ‘Connect a Wallet’ popup, select ‘MetaMask’ and click ‘OK’ for the warning message. Select the wallet in MetaMask and that should connect your wallet to Etherscan. Once successful, you will see it connected as below.
2.4 Click ‘unmint’ (function #11) and fill the details as below.
amount: Amount of tBTC v2 you want to convert to tBTC v1 in WEI. Go to https://eth-converter.com/ if you are unsure how to convert. I’m converting 0.001 tBTC v2 for this guide, and will enter as ‘1000000000000000’.
After entering the details, click ‘Write’.
2.5 You will now be prompted with MetaMask popup to confirm the transaction. Validate the details/gas costs and click ‘Confirm’.
2.6 Wait for transaction to be confirmed. You are now done with part 1& 2 and have successfully unminted tBTC v2 and got back your tBTC v1.
If you have any further questions — please feel free to join the Threshold Discord Server and ask !
Additional Resources :
- Threshold’s Discord: https://discord.gg/6vBmpBxP
- Keep’s Discord: https://discord.com/invite/wYezN7v
- NuCypher Discord: https://discord.gg/tyQ4jjeb
- Threshold’s Github: https://github.com/threshold-network
- Keep’s Twitter: https://twitter.com/keep_project
- NuCypher’s Twitter: https://twitter.com/nucypher