Skip to main content
Time to read: 1 min

Converting BTC to RBTC and vice versa

Mainnet Conversion​

In this section we will go over the steps of converting BTC to RBTC and vice versa in Bitcoin and Rootstock (RSK) Networks.

Tip

The minimum amount of Bitcoin to convert is 0.005 BTC for Mainnet.

BTC to RBTC conversion​

Instructions on how to do a Mainnet peg-in.

  • Any Bitcoin wallet that supports legacy (p2pkh) private key works for this step. In this section, we use the Electrum BTC wallet for connecting to BTC Mainnet.
    1. Download the wallet from Electrum Website
    2. Install Electrum
    3. Start Electrum
    4. Once Electrum starts, create or import a wallet
    5. Go to the third tab "Receive". You will see a Bitcoin Testnet address like below:
    Create a Legacy (`p2pkh`) walletn

Note: Use a legacy Bitcoin wallet (not Segwit) with a public key beginning with m or n, and a private key prefixed by p2pkh.

Send Bitcoin to Rootstock Federation address

  • The Rootstock Federation address is retrieved by making a Smart Contract call on Rootstock Mainnet. To make the call, you need to have MyCrypto installed:
    1. Select Rootstock (RSK) Network.
    2. Navigate to MyCrypto -> Contracts.
    3. Select Existing Contracts and choose Bridge from the drop-down menu.
    4. Click getFederationAddress to execute the call. It should look like the screenshot below:
    Get Rootstock Federation address from MyCrypto

Once you have the Rootstock Federation address, you can send Bitcoin to it from your Bitcoin address.

Note: You must send a minimum amount of 0.005 BTC.

  • To ensure the transaction is successful, we need to wait for 100 BTC network confirmations.

100 blocks * 10 minutes/block = 1000 minutes = 16.667 hours. That is, this will take approximately 17 hours.

  • You can get a corresponding RBTC address from your BTC private key by using the Rootstock Utils. If you do not want to compile the utility, you can download the latest release.

Note: when entering Bitcoin private key do not include p2pkh: in the front.

You can check balance of RBTC address on Metamask, MyCrypto, or any Rootstock compatible wallets.

Note: You have to wait a minimum of 100 confirmations + a minimum of 5 minutes for checking your RBTC balance.

RBTC to BTC conversion​

Instructions on how to do a Mainnet peg-out.

You can get a corresponding BTC address from your RBTC private key by using the Rootstock. If you do not want to compile the utility, you can download the latest release.

  • Rootstock Bridge Contract address: 0x0000000000000000000000000000000001000006
  • Note: The minimum amount to send must be at least 0.004 RBTC for Mainnet, sending any amount below this, will fail and funds will be reimbursed. The Gas Limit of the transaction needs to be manually set at 100,000 gas; otherwise the transaction will fail. Gas Price can be set to 0.06 gwei (or the gas price suggested by the wallet). Customize Gas in Metamask before send transaction on Rootstock

  • You can either use Electrum wallet downloaded earlier or from any Bitcoin explorer to check the balance.

    Note: The release process on Bitcoin network takes 4000 Rootstock block confirmations and at least 10 more minutes.

Testnet Conversion​

In this section we will go over the steps of converting t-BTC to tRBTC, and vice versa on the Bitcoin and Rootstock Testnets.

Tip

The minimum amount of Bitcoin to convert is 0.005 tBTC for Testnet.

tBTC to tRBTC conversion​

Instructions on how to do a Testnet peg-in.

We recommend to use Electrum BTC wallet for connecting to Bitcoin Testnet.

  • Download the wallet from Electrum Website
  • Install Electrum
  • Start Electrum in Testnet mode
    • For example on MacOS: /Applications/Electrum.app/Contents/MacOS/Electrum --testnet
  • After Electrum starts, create or import a wallet
  • Go to the third tab, "Receive". You will see a Bitcoin Testnet address like below.

Create a Legacy (p2pkh) wallet

  • Note: The Bitcoin wallet needs to be legacy (not Segwit) whose public key starts with either m or n, and private key starting with p2pkh: Get a Bitcoin Testnet address in Electrum Wallet

There are a few options to get Bitcoin on Testnet. We use https://testnet-faucet.mempool.co/.

  • The Rootstock Federation address is retrieved by making a Smart Contract call on Rootstock Testnet.
  • In order to make the call, you will need to have MyCrypto installed, select Rootstock Testnet in "More Networks", and Navigate to "MyCrypto -> Contracts -> Select Existing Contracts -> "Bridge" -> "getFederationAddress" to execute the call.
  • It should look like the screenshot below. Get Rootstock Federation address from MyCrypto Once you have the Rootstock Federation address, you can send Bitcoin to it from your Bitcoin address.
  • Note: You need to send a minimum amount of 0.01 tBTC for conversion.

  • You can get a corresponding tRBTC address from your tBTC private key by using github.com/rsksmart/utils. If you do not want to compile the utility, you can download the latest release.

  • Note: When entering Bitcoin private key do not include _p2pkh:_ in the front.

  • You can check the balance of the above tRBTC address on Metamask, MyCrypto or any Rootstock Testnet compatible wallets.
  • You have to wait a minimum of 10 confirmations + a minimum of 5 minutes for checking your RBTC balance.

tRBTC to tBTC conversion​

Instructions on how to do a Testnet peg-out.

Note

The release process on Bitcoin network takes 10 Rootstock block confirmations and at least 10 more minutes.

  • Rootstock Bridge Contract address: 0x0000000000000000000000000000000001000006
  • Important note: The minimum amount to send must be at least 0.004 tRBTC for Testnet, values below that will be rejected and reimbursed to the sender.
  • Gas Limit of the transaction needs to be manually set at 100,000 gas; otherwise the transaction will fail.
  • Gas Price can be set to 0.06 gwei. Customize Gas in Metamask before send transaction on Rootstock

You can either use Electrum wallet downloaded earlier or from any Bitcoin explorer to check the balance.

Last updated on by ivegabr