What is Powpeg? The Powpeg is RSK’s 2-way peg protocol used to do conversions between BTC and R-BTC. The RSK Powpeg protects private keys stored in special purpose PowHSMs based on tamper-proof secure elements, using a layered design which is referred to as defense-in-depth. To learn more about it, I suggest you read the article , from Sergio Demian Lerner and Sebastian Lindner. Building the Most Secure, Permissionless and Uncensorable Bitcoin Peg Part 1: how to convert BTCs in R-BTCs using RSK’s 2-way peg protocol I strongly recommend trying the 2-way peg on Testnet, before doing it on Mainnet. At this moment, the minimum amount of the process is 0.01 BTCs, so you must be careful not to do something wrong and lose your “real” funds. Overview Steps Get a BTC wallet with a Legacy address, like Electrum Have BTCs in this Legacy address Know the BTC address for RSK Peg using MyCrypto Send Bitcoin to the RSK Peg address Get your tBTC private key on Electrum Get tR-BTC address using your tBTC private key Use your tR-BTCs :) BTC wallet with a Legacy address Legacy address, or P2PKH, is an address format of Bitcoin which starts with a 1 in Mainnet. It is the original BTC address. All mnemonics and private keys can generate BTC legacy addresses. But be careful! Some wallets use the new SegWit formats and don't allow you to send BTC from your original Legacy address. My suggestion is to use the wallet, check out the options. I will show you how to do this in the next steps. Electrum download Electron wallet Go to the page. Electron wallet download I am using . I decided to use the and copied it into the folder. Windows OS Portable version C:\RSK\Electrum I strongly recommend verifying the GPG signatures to make sure that your download is original, there are instructions on the same page. If you are using Windows OS, check out some notes in the download page too. Run Electron wallet on BTC testnet Open the folder where you copied / installed the Electrum wallet, and run the following command to execute it on Testnet For example, I save it in the folder. C:\RSK\Electrum I will run: electrum -portable.exe --testnet -4.0 .9 It will open the Electrum app in a new window. Configuring Electrum in the first time This is the first time we are executing Electrum, so we need to finish the installation with some configuration in order to create a new wallet. Although you can connect to a trusted server (and this is recommended for secure use), letting Electrum decide on a server is a good beginner option. Select , and click the button. Auto connect Next You don’t need to change the , so click the button again. default_wallet Next There are some different options on the next step. I will create a Standard wallet, and then send BTCs to this new wallet. Select the click the button. Standard wallet Next The seed or mnemonic is a group of words which generates all addresses in a wallet, using the pattern defined at BIP39 Choose click the button. Create a new seed Next The next step is very important! You must NOT choose Segwit! So select and click the button. Legacy Next Write down your seed phrase, or mnemonic, or backup phrase (all these terms mean the same), with 12 words. This is used to recover your account, in case you lose your password. Save your seed in a safe place. Do not show your seed to anyone! For example, my seed in this tutorial is endless core secret strategy other tomato beef young snake ceiling hurdle filter I am showing it to you because this is a tutorial and we're using the Testnet, however I will never store real cryptos using this seed :) After saving your seed, click the button. Next Paste your seed to confirm that you can restore it properly then click the button. Next This is the result for my example seed: Remember: the seed phrase is the most important thing in a wallet / account! You can also define a password to encrypt your seed. I will not do it here because it is only a tutorial Now you can decide if you would like to keep your Electrum updated. It is up to you. The next message is to alert us that we are in Testnet. Perfect! This is our goal. This is your wallet Get your BTC Legacy address Go to the third tab, . Receive Change the to . Expires after Never Click the button new address You will see a Bitcoin Testnet address like below. My Legacy BTC testnet address is: n2pUF7gJiFZoSpJJBxvnzPVuJ7qN9vK6aT You can check it out in the zoomed image: BTC Testnet faucet We need some t-BTCs to experience this process. So get test Bitcoin from Testnet Faucet. There are a few options to get Bitcoin on Testnet. We use https://testnet-faucet.mempool.co/ This site gives us 0.01 BTCs each hour. Because 0.01 BTCs is the minimum to send in to PowPeg and we need to pay the miner fee, we must have more than 0.01 BTCs. So I will do the process to get 0.01 BTCs twice, in 2 hours. n2pUF7gJiFZoSpJJBxvnzPVuJ7qN9vK6aT https://live.blockcypher.com/btc-testnet/address/n2pUF7gJiFZoSpJJBxvnzPVuJ7qN9vK6aT Take a look in some requests n2pUF7gJiFZoSpJJBxvnzPVuJ7qN9vK6aT https://live.blockcypher.com/btc-testnet/address/n2pUF7gJiFZoSpJJBxvnzPVuJ7qN9vK6aT You can check your balance in - a block explorer for Bitcoin testnet Blockcypher Know the BTC address for RSK Peg using MyCrypto Now you need to know the Peg address, or RSK Federation address. The RSK Federation address is retrieved by making a Smart Contract call on RSK Testnet. You will execute a call to the smart contract Bridge to get the address. An option is using MyCrypto The most secure and trusted way to do it is to install the desktop version of MyCrypto on your computer. Check your version in page MyCrypto’s download Another alternative, though not so secure is to use the web app. In this case it is important to be sure that you are in the “real” MyCrypto website, be careful not to go to a false website. Here I will do in MyCrypto web app In the main page, navigate to or go directly to Tools => Interact with contracts https://app.mycrypto.com/interact-with-contracts Select Network RSK Testnet Select Contract Bridge Click on Interact with Contract In , select to execute a call to the smart contract Bridge and get the address. Read / Write Contract getFederationAddress It should look like the screenshot below. Copy the address. For example, now it is: 2N1GMB8gxHYR5HLPSRgf9CJ9Lunjb9CTnKB Send Bitcoin to the RSK Peg address Great! Now you have more than 0.01 BTCs and you know the Peg address. The next step is to send Bitcoin to the Peg address, or RSK Federation address. Once you have the RSK Federation address, you can send Bitcoin to it from your Bitcoin address. Note: You need to send a minimum amount of 0.01 BTC for conversion. Come back to Electrum to do the transfer Go to the tab Send Pay attention: the value is represented in mBTC. 1 mBTC = 0.0010 BTC So 0.01 BTC = 10 mBTC Pay to: 2N1GMB8gxHYR5HLPSRgf9CJ9Lunjb9CTnKB Amount: 10 Click on the button Pay Confirm the transaction and click the button. Send Done! Now you must be patient :) You have to wait a minimum of 100 confirmations + a minimum of 5 minutes for checking your R-BTC balance. Get your tBTC private key on Electrum Here I am doing a tutorial, so I can share it only for educational purposes. Go to menu Wallet => Private Keys => Export You don’t need to export it, just copy the first address and your private key, like mine: Address: n2pUF7gJiFZoSpJJBxvnzPVuJ7qN9vK6aT Private key: p2pkh:cUkVmQJPb5wwfW1pvqVfGAcF7fSPQN7nJGFJaYr59QoQ5pabdswR Get tR-BTC address using your tBTC private key The same private key can be used to generate addresses for different networks. https://iancoleman.io/bip39/ The private key for your Bitcoin address will be used to discover your tR-BTC address, and also to transfer your tR-BTC later. RSK has a tool to get your tR-BTC in a secure way, on your desktop, without exposing your private key on the internet. So, let’s use it! Go to . github.com/rsksmart/utils If you do not want to compile the utility, you can download the . I will use it. latest release Go to last release page and click on to download it build.zip I saved, unzipped it in and renamed to C:\RSK rsk-utils-build In the build folder, open index.html in your browser For example, my path is file:///C:/RSK/rsk-utils-build/build/index.html Now enter your Bitcoin private key. Do include : in the front! NOT p2pkh My saved private key is: p2pkh:cUkVmQJPb5wwfW1pvqVfGAcF7fSPQN7nJGFJaYr59QoQ5pabdswR So I will fill only cUkVmQJPb5wwfW1pvqVfGAcF7fSPQN7nJGFJaYr59QoQ5pabdswR Click on the button. Transform Then you’ll get your RSK address. In my example, the RSK address is 2226ac4054d6a0ebfec341014974796ede3701de Remember: never share your private key! Here I am doing a tutorial, so I can share it only for educational purposes. Next steps Monitor your address on RSK explorer You can monitor your address on . RSK explorer Take a look at my RSK testnet address: https://explorer.testnet.rsk.co/address/0xc5b5ced7337f059eff3b307284aee9f60926be7869b67c8ee198b410a2eb6e40 Note 1 Maybe the first time you search in explorer, you’ll get a block information, and not an address information. If this happens, just change block for address in the URL For example: https://explorer.testnet.rsk.co/block/0xc5b5ced7337f059eff3b307284aee9f60926be7869b67c8ee198b410a2eb6e40 Will be https://explorer.testnet.rsk.co/address/0xc5b5ced7337f059eff3b307284aee9f60926be7869b67c8ee198b410a2eb6e40 Note 2 Remember that the 2-way peg process takes some time. You have to wait a minimum of 100 confirmations + a minimum of 5 minutes for checking your R-BTC balance Probably the first time you try to check your address in explorer, it will return a Not found message. This happens because your address didn’t receive any transaction yet, so the explorer doesn’t know the address until now. As seen in this image: But after 100 confirmations + a minimum of 5 minutes (more than 16h hours), I got my balance! How to use my R-BTC? RSK has many wallets, check it out in on DevPortal. wallet’s page The inverse process: Peg out Additionally, I would like to do the inverse process: I will transform my R-BTC back into BTC. This process will be explained in the next article. Final message I showed you how to transform your BTCs in tR-BTCs and opened a door for the DeFi possibilities over Bitcoin on the RSK network. I hope this tutorial has been helpful and I’d appreciate your feedback. Happy with this tutorial? Share it if you like it :)