dAPP
Published on 
21 October, 2020

How to send BTC through the 2wayPeg Federation to get rBTC

Translation from this original article written by Nicolás E. Bourbon.

People are starting to explore the existing applications in RSK, the Bitcoin sidechain, and they are wondering how to start. In order to do this it is necessary to exchange BTC for rBTC, the native token of RSK, which value is pegged to Bitcoin 1BTC = 1rBTC. This value is achieved because for each rBTC issued a BTC is “locked”.

Exchanging Bitcoin for rBTC can be done in several ways:

- “Custodial”: taking advantage of Coinswitch, which nowadays is one of the best options with low fees, its integration within Defiant app or other exchanges such as Bitfinex.

- “Non Custodial”: This will be the focus of this post since I wanted to show you how to transfer BTC to rBTC and vice versa without depending on a third party (custodian), having control of the process in your hands. This way you can send the amount you want and pay just the network’s fee.

Devices to use: In my case, Ledger Hardware Wallet, Electrum and MyCrypto site

(I know this can be done with other HW like Trezor and with other sites but this setup is the one I tried because it allowed me to configure derivation paths in BTC as long as in rBTC and sign transactions on both sides with my Hardware wallet).

Step 1: Get a Legacy address and transfer some sats

Note: Legacy addresses are those beginning with 1. If you already have a Legacy wallet, you can go to step 2.

As I have the HW Ledger connected to Electrum, I simply opened Electrum, clicked on “New Wallet” and I followed the steps indicating that I already had a hardware wallet and that I wanted a Legacy Wallet. (Ledger Live also allows you to generate legacy wallets, but it seemed better to do it with electrum to have full control of the address to use, the utxo to use, etc.)

1 zzZJlTdU5LYkWH2WwLF8cQ 1 2

Once the Legacy wallet was generated, I copied an address and sent a few sats from my Segwit wallet (0.01 BTC minimum although it is recommended a little bit more).

Step 2: Get the BTC address of current peg

For this step we have to go to https://mycrypto.com/contracts/interact. Notice that you have to select RSK in the upper right corner and then

In “Selecting Existing Contract”, select Bridge and then click Access

In Read/Write click on “GetFederationAddress” and then click READ that will be shown after selecting

1 RF2B6l8LIK1TqAILe4P0iw

Step 3: Send BTC (0.01 BTC min) from Legacy account to the Peg address that you got in the previous step

1 GNcLlt7skAT2XZfkFE5FfA

You have to wait 100 Bitcoin confirmations and that’s it (approx 16 hours). You should have your rBTC.

It is important to keep in mind that sending your BTC from Legacy should ideally be done from a single address. Although in the case that you consolidated multiple inputs, then the Peg will be done to the first address it finds within the inputs. If you want a simple and clean process, you can send everything from a single address. (This address can be used multiple times later for next pegs).

Step 4: Withdraw your rBTC

Here come a series of steps. With the Ledger connected and the RSK app open, you have to open MyCrypto, select the RSK network but … in the “Addresses”, you have to write m/44'/0'/0'/0

Once that “Derivation path” is entered as I put it above, click "ok" after selecting the address # 1 which is the one with the rbtc balance.

1 TsRl5uoGuqeJTZVYNEPTrQ

Once you click, you will see the balance in your Mycrypto wallet, but it is convenient to send it from there to your preferred address in RSK, since this address only appears with the custom derivation path. So you simply send this balance to your own wallet.

Note: You can also save that special rBTC address which together with your Legacy BTC address will become your usual addresses to bridge between one network and the other. Make sure that these addresses you use are not public so your identity is preserved.

1 pzMtKBSvl817 In

Done this, click on “Send Transaction” and confirm!

1 SQhJt9KrE2Xft7 RkaJ EQ

With this last step the process is finished! Enjoy RSK.

Now it is turn to send rBTC to BTC

The process to send rBTC to BTC is the reverse of what we did previously. The elements to have available are:

  1. The legacy account just as it was explained before
  2. The account in MyCrypto using the derivation path m/44'/0'/0'/0 as we did before
  3. Mycrypto account directly using Ledger with RSK app and Mainnet Address

Step 1:

We take the first address from point 2 (above) and then open our standard MyCrypto (or any other RSK wallet) account from point 3 as selected here

We send there the necessary rBTC, at least 0.008

Step 2:

Once it is credited to the special address with the derivation path and we have verified that the balance has been credited to start step 2, we select that special address and we are going to send from there to the Peg

1 TsRl5uoGuqeJTZVYNEPTrQ 1

To have in mind: Now you have to send to the following address putting the following parameters

  • RSK Bridge Contract address: 0x0000000000000000000000000000000001000006
  • Gas Limit: 100000
  • Gas Price: 0.06
  • Min to send 0.08rBTC
  • Unclick “Automatically calculate gas limit” so you can enter suggested amounts
1 ACWcQ6dvpSIq BT4FYw UA

TroubleShooting: *When I put the gas limit in mycrypto, the “Amount” cell went red and it canceled the “send transaction” button. If that happens to you, don’t worry, you just go to the amount to send and rewrite it

Step 3:

After 4000 RSK confirmations (approx. 100 BTC confirmations), the only thing left to do is, with the same HW wallet, go back to our Legacy Wallet as detailed at the beginning of this post.

Now you can withdraw your bitcoins!

1 aeLi7jmc9TUV5jUtQmqJbw

Conclusion:

The process, although it takes some steps, is the safest way without intermediaries to get your rBTC. Of course, it is not for newcomers, but if you want to seriously put liquidity in rBTC, the current options do not have enough liquidity.

The RSK team is developing new tools that will be launched soon so the whole process could be done automatically and with the possibility to choose between convenience with custody vs non-custodial models but perhaps slower due to the issue of confirmations and process security.

To follow the news about it go to

https://developers.rsk.co/rsk/architecture/2-way-peg/

As I said, this process could be tested with other tools, but since I did not test them, I cannot make a recommendation. What I know is necessary is to have a device that allows you to generate and sign transactions from a public key with which we will connect to BTC and RSK. In this case Ledger and I understand Trezor through Electrum and MyCrypto allows you to do so.

Keep in mind

If you use a Trezor T and MyCrypto gives you an error when moving the rBTCs, check this link:, you should check this link:

https://developers.rsk.co/rsk/rbtc/conversion/with-trezor-t/

* Note that the amounts may not match exactly through the entire document since I made different movements in the middle.

Copyright © 2018-2024 Money On Chain.
Disclaimer, Privacy Policy and Terms & Conditions
crossmenu