A Smart Contract Platform on Top of Bitcoin - Getting Started With RSKby@rootstock_io
447 reads
447 reads

A Smart Contract Platform on Top of Bitcoin - Getting Started With RSK

by RootstockSeptember 6th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

RSK Smart Contract Platform is a side-chain to the main Bitcoin network which means that it does not drain power from the Bitcoin network. The RSK blockchain is connected to the Bitcoin blockchain via a 2-way peg. RSK smart contracts are already being used for numerous purposes, courtesy of the level of confidence they enjoy among large enterprises and government regulators. The platform uses RIF Lumino Network, the first off-chain state channel network launched on RSK, which enables users to freely interact with other cross-blockchain networks such as the Lightning Network and Raiden Network.
featured image - A Smart Contract Platform on Top of Bitcoin - Getting Started With RSK
Rootstock HackerNoon profile picture

Bitcoin showed us that blockchain technology can be leveraged to create a sound and trustful currency. Ethereum displayed blockchain’s potential by developing smart contracts that extend the technology’s scope beyond powering a currency.

One step further, RSK blockchain is building smart contracts on the Bitcoin protocol, thereby combining the security and brand of Bitcoin with the robustness of smart contracts.

In this article, we deep dive into RSK smart contracts and explore how they are helping developers create a meaningful change in society, one transaction at a time.

What’s Different About RSK Smart Contracts?

Today, there are a large number of blockchain projects that claim to be scalable and decentralized smart contract protocols. On closer look, however, it seems that the vast majority of these protocols have issues at least in one of the areas of the infamous blockchain trilemma: scalability, decentralization and security. 

If a protocol is decentralized and secured, it might not be scalable. Against that backdrop, there has been no smart contract platform to date that successfully tackled the three major blockchain bottlenecks. RSK smart contracts want to fix this.

RSK is a side-chain to the main Bitcoin network which means that it does not drain power from the Bitcoin network. Notably, the RSK blockchain is connected to the Bitcoin blockchain via a 2-way peg. 

In simple terms, a 2-way means a mechanism that facilitates the seamless movement of digital assets from one chain to another. In RSK’s case, users are required to lock up their BTC in exchange for an equivalent amount of rBTC in the RSK side-chain. rBTC tracks the price of Bitcoin and can be used for various purposes within the RSK ecosystem including interaction with smart contracts and dApps built on the RSK blockchain.

RSK smart contracts utilize the Bitcoin protocol which imparts the best level of tech security in existence to the ecosystem. Bitcoin is the time-tested, battle-hardened and oldest cryptocurrency in existence with strong market goodwill. RSK taps these benefits for its smart contracts to ensure that the possibility of any potential tech vulnerability is mitigated if not eliminated. 

Putting the Scalability Argument to Rest

Now, many readers might argue that the Bitcoin protocol is notoriously slow in terms of transactions and takes a lot of time compared to other smart contract platforms. Wouldn’t the RSK smart contracts struggle with the scalability issue too? 

In addition to being an off-chain network itself, RSK blockchain uses RIF Lumino Network, the first off-chain state channel network launched on RSK. RIF Lumino is an indispensable part of the wider RIF ecosystem and enables users to freely interact with other cross-blockchain off-chain networks such as the Lightning Network and Raiden Network, among others.

The RIF Lumino Network allows RSK users to send, receive and exchange tokens rapidly and reliably. Being an off-chain, interoperable second-layer network, RIF Lumino successfully addresses the skepticism about the scalability of the RSK smart contracts.  

What Can RSK Smart Contracts Be Used For?

Smart contracts essentially have a myriad of blockchain use cases. Fundamentally, smart contracts automate an obligation between two or more parties. Keeping this in mind, consider the endless use-cases of smart contracts across various industries such as supply chain management, public welfare, gaming, governance and finance just to mention a few. RSK smart contracts are already being used for numerous purposes, courtesy of the level of confidence they enjoy among large enterprises and government regulators. 

For instance, the Argentine gas regulator, Enargas, is using RSK smart contracts to develop digital identities to streamline the end-to-end process of registration, installation and distribution of gas. Through blockchain-powered RSK smart contracts, the regulator ensures complete transparency and operational efficiency that fastens the entire gas distribution process. RSK smart contracts also enable Enargas to quickly track and address any complaints made by end-users and ensure continual supervision over the movement of gas-related goods such as Licensed Gas Fitters.

Similarly, RSK is helping one of the largest Colombian banks, Banco Davivienda, by offering a blockchain-based micro-payment wallet that ensures quick and safe execution of bank transfers among the users. The transaction fee charged by the app is minuscule compared to the typical fee charged by credit cards, banks and other financial institutions.

RSK Smart Contracts Powering DeFi Platforms

In addition to the aforementioned use-cases across industries, RSK smart contracts are powering several decentralized finance (DeFi) platforms to make finance more equitable and easier to access for people across the globe.

The RIF on Chain (ROC) DeFi protocol is one such platform powered by RSK smart contracts. For the uninitiated, ROC is a Bitcoin-centric DeFi ecosystem developed on top of the RSK blockchain that enables bitcoin holders to generate passive income and caters to users’ need for volatility-free digital currency via bitcoin-collateralized stablecoins.

Digging deeper, RSK smart contracts power the various digital tokens that form the basic architecture of the ROC ecosystem – RDOC (a USD-pegged stablecoin guaranteed by RSK smart contracts), RIFP (the Bitcoin-based passive income generating token), and RIFX (an RIF leveraged decentralized long position).

Similarly, RSK smart contracts also undergird the Money on Chain (MOC) DeFi platform launched in December last year. Akin to ROC, MOC has its own tokens with peculiar functions and characteristics, all powered by RSK smart contracts.

The scope of possibilities is virtually limitless when it comes to smart contracts, even more so when speaking of RSK smart contracts that offer developers the security and brand of Bitcoin but without the scalability and latency issues. 

Opportunities for Developers

There is no dearth of tools and services for developers keen on developing on RSK smart contracts as will be elucidated in this section. RSK provides an opportunity for developers to create, import and deploy smart contracts solutions on top of Bitcoin. Developers can do all this without having to learn any new programming language from scratch. Just knowing Solidity would suffice. 

RSK’s engine is a forked version of the EVM (Ethereum Virtual Machine) which enables it to freely interact with Ethereum smart contracts and all other tools required to run them. 

Developers can deploy RSK smart contracts for a variety of purposes, including creating non fungible tokens, stablecoins, blockchain oracles and self sovereign identities among others. To do this, RSK provides a wide array of developer tools and packages that can be tapped to unlock a range of possibilities.

RSK3 Libraries

Recently, IOV Labs unveiled the first public release of rsk3.js, an exhaustive suite of Javascript libraries aimed towards helping developers looking to build on the RSK blockchain. 

Much like the Ethereum blockchain’s web3.js libraries, rsk libraries allow developers to freely interact with a local or remote RSK blockchain node which fosters a conducive environment for developers to perform function calls. 

The rsk3 libraries put an enormous focus on the level of security, operability, and compatibility with the RSK blockchain to make it easier and safe for developers to build smart contract applications. 

Stellar Security

In terms of security, rsk3 libraries successfully underwent a stringent independent security audit conducted by smart contract security protocol Quantstamp. This ensures that developers have a safe and sound environment to build in without having to worry about any potential security breach.

Focus on Simplicity

Programming can be complex, especially when you add smart contracts programming to the mix which makes the coding part all the more verbose and difficult. To tackle this hurdle, rsk3 libraries ensure there is less “noise” in the smart contract code compared to the more verbose Ethereum’s web3 libraries. There are numerous benefits of having short, and precise codes including reduced latency and shorter functional calls among others.

Opening new Horizons via RWallet 

Along with the rsk3.js libraries, IOV Labs launched the multi-utility RWallet, the official digital wallet for the RSK ecosystem available on both iOS and Android platforms.

For the uninitiated, in May this year, RSK unveiled the RWallet code base for developers to help them create their own wallet on top of the RSK blockchain. After months of development and continual refinements, the official version of RWallet is officially out that leverages the rsk3 libraries. 

Bottom Line

Smart contracts are disrupting all facets of the world economy as we know it and it won’t be long before their use becomes the norm for every industry. 

Smart contracts’ unique proposition lays in that they function underneath the end-user interface meaning that during a normal course, users may not even get to know that they interacted with a smart contract. This subtlety is what primes smart contracts to make a significant impact and RSK blockchain is committed to bringing it to fruition.

RSK blockchain encourages developers to try building on their smart contracts. 

To begin, developers only need to install an RSK local node, Truffle & Ganache, edit the smart contract, and compile and deploy it to run it. Developers can use the numerous tutorials and webinars shared by RSK that explain the technical nitty-gritty required to build applications using RSK smart contracts. There are also resources that teach how to create collectible tokens on the RSK Network.