---
# System prepended metadata

title: RSK Research

---

# RSK Research

## Summary
Overall, USDC on RSK is a very compelling option. There are some limiting factors whose magnitude are worth discussing as a team (limiting factors indicated by :-1:)

- :+1: Native Bi-directional swaps between `rBTC` <-> `BTC`
- :+1: Atomic Swaps between `rBTC` <-> Native tokens on RSK
- :+1: Native bi-directional swaps between `rBTC` <-> Any `ERC-20` token on Ethereum

The above three bullets in addition to Native USDC theoretically existing on RSK opens up clear on/off ramp paths into and out of Bitcoin and any ERC-20 compliant token on Ethereum. This assumes that USDC <-> fiat liquidity providers exist

- :+1: RSK layer 1 contains an EVM fork which makes it so all ethereum developer tooling works for RSK as well
- :+1: There is an open-source RSK wallet that's available in both app stores. It can be cloned from github as-is and used to jumpstart wallet development. More details on this [below](https://hackmd.io/HBVF7ZIlRNSvklv2nSJwlA#Wallets)
    - Metamask can be used as well
- :-1: there is a required minimum threshold of 0.005 `BTC` / 0.004 `rBTC` for swapping between `BTC` <-> `rBTC`. This is currently ~$200. This is a bit high but is it too high? something we'll want to discuss
- :-1: swapping from `BTC` -> `rBTC` requires a minimum of 100 Bitcoin block confirmations (~16.67 hours) and `rBTC` -> `BTC` requires Bitcoin 200 block confirmations. 
    - there are roughly 20 RSK block confirmations for every 1 Bitcoin block confirmation
- :+1: :-1: Significantly cheaper gas fees relative to `ETH` [(source)](https://rskgasstation.info/). $4.91 as of 04/25/2022. Generally speaking, still feels a bit expensive though.

The remainder of this doc contains detailed info on the above bullets

## RSK engine is a fork of EVM 
- Compatible with Ethereum smart contracts (AKA solidity)
- Compatible with existing Ethereum tooling to streamline development (e.g. Truffle and Hardhat)

## Native support for bi-directional `rBTC <-> BTC` swaps 
- Supported via [Powpeg](https://developers.rsk.co/rsk/architecture/powpeg/)
    - Powpeg is a two-way peg (2WP) protocol that allows transfers of a cryptocurrency from a main blockchain to a secondary blockchain and vice versa. In the case of **RSK**, **Bitcoin** is the **main** chain and **RSK** is the secondary chain
- Every `rBTC` (or fraction of `rBTC`) unlocked on the RSK blockchain requires `BTC` to be locked on the Bitcoin blockchain. This mechanism ensures there is a one-to-one relationship between `BTC` and `rBTC` (1 `BTC` = 1 `rBTC`), which is guaranteed by the RSK protocol.
- A **peg-in** refers to swapping `BTC -> rBTC`
    - Performing a peg-in involves sending BTC to a specific address on the Bitcoin network, and subsequently informing a native smart contract (called the Bridge) on the RSK network about this transaction. This subsequently releases bitcoins (RBTC) on the RSK network. In summary, a **peg-in**:
        - Converts `BTC` -> `rBTC`
        - Locks BTC on the Bitcoin network
        - Releases RBTC on the RSK network
- A **peg-out** refers to swapping `rBTC -> BTC`
    - Performing a peg-out involves sending `rBTC` to a native smart contract (Called the Bridge) on the RSK network. After a required number of confirmations blocks occur the Bridge builds the transaction to release `BTC` on the Bitcoin network. The # of block confirmations is significant and creates non-negligible wait times In summary, a **peg-out**:
        - Converts `rBTC` to `BTC`
        - Locks `rBTC` on the RSK network
        - Releases `BTC` on the Bitcoin network

### Noteworthy peg-in / peg-out info
- There is a minimum value threshold for peg-ins. Currently, amounts must exceed 0.005 `BTC` (~$200 as of 04/25/2022) and 0.004 `rBTC`, respectively
- not all types of BTC address formats are support for peg-ins
    - :warning: **TODO**: find supported address types
- There is a global maximum amount of Bitcoins that can be concurrently locked in at any given time
- Users cannot choose what address they will receive their assets on, instead the receiving address is determined using the public key of the sender, so that both accounts are controlled by the same private key.
    - the upcoming RSK release (IRIS-3.0), this is partially changing. The PowPeg will allow the user to specify the receiving address for peg-ins (`BTC` → `rBTC`).
- 

## Wallets
- [rWallet](https://github.com/rsksmart/rwallet) is an open-source wallet that can be used to send, receive and swap Bitcoin (BTC), smartBitcoin (RBTC), RIF Token (RIF), Dollar on Chain (DOC).
    - Codebase can be used as a starting point to build our own mobile wallet
    - Existle on [iOS App store](https://apps.apple.com/us/app/id1489241342) and [Google Play store](https://play.google.com/store/apps/details?id=com.rsk.rwallet.v2) as well. 
- 

## Atomic swaps between RSK native tokens and rBTC
- [RSK Swap](https://app.rskswap.com/swap) - A Fork of Uniswap v2 for RSK
    - `rUSDC` already exists on RSK backed by `USDC` locked on Ethereum
        - Conceptually, locking here works exactly the way it does between RSK and Bitcoin
        - [There's a total supply of 88 `rUSDC` on RSK (lol)](https://explorer.rsk.co/address/0x1bda44fda023f2af8280a16fd1b01d1a493ba6c4)
            

## Interoperability between Ethereum and RSK
- Specifically, There's an Ethereum/RSK Bridge that allows to move ERC20 tokens between one chain and the other. Conceptually, this works in exactly the same way the RSK <-> Bitcoin Bridge works
    - the bridge on one chain will receive and lock the ERC20 tokens, then it will emit an event that will be served to the bridge on the other chain. There is a Federation in charge of sending the event from one contract to the other. Once the bridge on the other chain receives the event from the Federation, it mints the tokens on the mirror ERC20 contract.
- [ETH/RSK Bridge](https://tokenbridge.rsk.co/)
    

## Resources
- [RSK Gas Fees Explained](https://developers.rsk.co/rsk/rbtc/gas/)
- [RSK Stats](https://stats.rsk.co/)
- [RSK Swap](https://app.rskswap.com/swap) - A Fork of Uniswap v2 for RSK
- [RSK Block Expolorer](https://explorer.rsk.co/)
- [RSK Official Stablecoin Guide](https://developers.rsk.co/guides/stablecoin/)