The Ultimate Guide to Rootstock Blockchain
At its very core, Rootstock is a combination of:
- A Turing-complete resource-accounted deterministic virtual machine (for smart contracts)
- A two-way pegged Bitcoin sidechain (for BTC denominated trade)
- A dynamic hybrid merge-mining/federated consensus protocol (for consensus security), and a low-latency network (for fast payments).
So, what exactly does this mean and why has this project gained so much traction and interest? Let’s find out.
A Brief History of Bitcoin and Ethereum
The world was changed forever when Satoshi Nakamoto released the Bitcoin whitepaper on November 2008. Bitcoin gave the world a way to disrupt its financial system. For the first time, we had a system which provided a decentralized currency not owned by one single entity. The way they achieved that was by utilizing the blockchain technology. The blockchain is basically an open ledger, anyone can access all the information and transaction by merely consulting the blockchain.
This was, in essence, the first generation of blockchain technology. Creating a payment system which allows people to utilize the blockchain to send bitcoins to one another without going through a central bank. Bitcoin utilizes a simple, non-Turing complete scripting language. The scripting language allows users to add some interesting complications to their transactions, however, at the end of the day, Bitcoin is a payment system, and that’s it.
Many people were wondering if this was the limit of the blockchain technology, surely it must have more potential. One of those people was a young Russian-Canadian programmer named Vitalik Buterin. In later 2013, Buterin presented a paper which outlined the need for Bitcoin’s chain to accommodate for smart contracts.
His proposal would require for a hard-fork, which the Bitcoin community was looking to avoid. As a result, his ideas were shut down. He would go on to use these exact principles to create Ethereum, which would carve out its own niche giving developers a platform to code smart contracts and produce decentralized applications.
Now, before we go any further, let’s understand what we mean by smart contracts.
What are Smart Contracts?
Smart contracts are automated contracts. They are self-executing with specific instructions written on its code which gets executed when certain conditions are made.
You can learn more about smart contracts in our in-depth guide here.
Smart contracts are how things get done in the Ethereum ecosystem. When someone wants to get a particular task done in Ethereum they initiate a smart contract with one or more people.
Smart contracts are a series of instructions, written using the programming language “solidity”, which works on the basis of the IFTTT logic aka the IF-THIS-THEN-THAT logic. Basically, if the first set of instructions are done then execute the next function and after that the next and keep on repeating until you reach the end of the contract.
The idea of smart contracts was conceptualized by Nick Szabo, and he equated the concept of smart contracts to that of vending machines. Does that sound confusing to you?
Well… consider this for a second. How does a vending machine work?
Step 1: You give the vending machine some money.
Step 2: You punch in the button corresponding to the item that you want.
Step 3: The item comes out and you collect it.
Now look at all those steps and think about it.
Will any of the steps work if the previous one wasn’t executed? Each and every one of those steps is directly related to the previous step. There is one more factor to think about, and it is an integral part of smart contracts. You see, in your entire interaction with the vending machine, you (the requestor) were solely working with the machine (the provider). There were absolutely no third parties involved.
That is exactly how a smart contract works. Two parties can interact via a smart contract without going through a third party.
Alright, so now you know what smart contracts are. Let’s now go to the next important topic.
What are Sidechains?
Sidechains as a concept have been around for quite some time now. The idea is to have a blockchain which runs in parallel to the main blockchain. It allows users to move tokens and other digital assets from the main blockchain to the side chain and vice-versa.
How does that happen?
The sidechain is attached to the parent chain via a two-way peg. So, what does this
two-way peg do?
It enables the interchangeability of assets at a predetermined rate between the parent blockchain and the sidechain. So, if a user were to interact with the sidechain, how exactly will they do it?
- The user on the main blockchain locks up their coins by sending it to an output address. This makes sure that they can’t spend those coins anywhere else.
- Upon completion of this transaction, a confirmation is broadcasted across both the main chain and the sidechain. Following this confirmation, a short waiting period is assigned to the user for extra security
- The economics within the sidechain can happen only via the use of tokens. The tokens can be either the token of the main blockchain or some native token that is being used by the side chain. So, after the waiting period is over, an equivalent number of tokens which is proportionally similar to the number of coins that have been locked away is released on the sidechain.
- The exact process happens in reverse when one goes back from the sidechain to the main chain.
Rootstock (RSK) is a smart contract platform that is connected to the Bitcoin blockchain through sidechain technology. Rootstock is an advanced version of QixCoin, a turing-complete cryptocurrency created in 2013 by the same development team.
The Rootstock chain is connected to the to the Bitcoin blockchain via a 2-way peg. The rootstock chain uses Smart Bitcoins or SBTC to fuel its internal ecosystem. The users lock up their BTC and get an equivalent amount of SBTC in the side chain. These coins can be used to deploy or to interact with smart contracts and dApps on the Rootstock blockchain.
So, let’s look at some of the great features that Rootstock can potentially bring to the Bitcoin blockchain.
- Many people feel that Bitcoin is missing out by not incorporating smart contracts. Smart contracts are a proven commodity and Bitcoin also happens to have the oldest and one of the more robust blockchain. It is only natural for Bitcoin to have a smart contract platform.
- RSK blockchain is secured by “merge mining”, meaning that it will be as secure as Bitcoin when it comes to preventing double-spending and achieving settlement finality.
- Scalability is the biggest issue that is being faced by cryptocurrency. In fact, it won’t be a stretch to say that if this isn’t solved any time soon, then we can say goodbye to mainstream crypto adoption. RSK has the potential to scale up Bitcoin far beyond its current state. RSK can scale up to 300 transactions per second and it doesn’t even need to sacrifice decentralization and reduce storage space.
- The transaction times are another reason why Bitcoin isn’t really practical for everyday use. RSK is going to bring in instant payments to the network by using new protocol-like DECOR and GHOST. They will also be creating blocks at 10-second intervals.
The RSK Virtual Machine
A smart contract needs to have three properties for successful execution. The properties are as follows:
- Deterministic: The contract must always give the same output to the same set of inputs, regardless of where it is being executed.
- Terminable: There must be a mechanism which halts the execution of the program.
- Isolation: The contract must execute in an isolated location so that in case it has any negative side effects, it won’t affect the entire ecosystem.
To make sure that the smart contracts have this property, they are executed in an environment called virtual machines. Rootstock utilizes its Rootstock virtual machine or RVM to fire up its smart contracts.
There is a lot of similarities between the RVM and the EVM.
- They both are virtual machines which deploy and runs smart contracts
- While EVM uses gas for fueling its smart contracts, RVM uses SBTC to fuel its smart contracts
- The RVM is also op-code level compatible with EVM which enables Ethereum contracts to run flawlessly on RSK.
This similarity exists because Rootstock wants developers who are comfortable with Ethereum to start developing on Rootstock with ease.
The RSK Sidechain and Federations
The Bitcoin blockchain and the Rootstock sidechain are connected by a 2-way peg which acts as a bridge. As we have stated before, in order to interact with the Rootstock chain, users have to lock up some of their Bitcoin in the bridge. Now, who exactly looks after these bitcoins?
A third-party-free two-way peg can be created by using smart contracts on both platforms, however, as of right now, Bitcoin doesn’t support native smart contracts. This is why Rootstock opted for another route by requiring trust on a set of a semi-trusted third-parties (STTP). 25 STTPs have come together to form the Rootstock Federation.
This federation serves as a gateway between the main chain and the side chain. The biggest role of the federation is to determine when the user’s coins are locked up and released. Since they will be dealing with a lot of money, what guarantees are there that they will act in the interest of the system?
- Federation members must be well-respected members in the crypto community
- They should have technical ability to maintain a secure network node. Locking and unlocking of funds is done by the secure network node.
- In order to become a part of the Federation, a major requirement is the ability to audit the behavior of the software that powers the node
The Federation and the locked Bitcoins become part of a multi-sig wallet.
The easiest way of understanding how a multi-signature (multi-sig) wallet works like is by thinking of a safe which needs multiple keys to operate. A multi-signature wallet is great for 2 purposes:
- To create more security for your wallet and save yourself from human error.
- To create a more democratic wallet which can be used by one or more people.
The multi-sig wallet is a simple m-for-n multisig. Basically, if “n” is the total number of participants in the multi-sig wallet, then “m” is the least number of signees required to release the funds.
Merged Mining in Rootstock
Rootstock believes that PoW (Proof of Work aka the consensus mechanism used by Bitcoin) is the only consensus system which provides proper finality. The reason being that it is the only consensus system which actually consumes a valuable resource (electricity).
Having said that, there is a problem with high rate PoW.
In order to make sure that there is a periodic supply of blocks with low orphan waste, miners have to stop their hardware and restart them the moment a new block is discovered. This will result in mining time gaps and general network latencies. These gaps reduce the efficiency of the overall mining process.
So, to address this issue, Rootstock uses a block reward sharing scheme called “DECOR+” to reduce competition and allow miners late switch to the Rootstock best block. We will discuss more DECOR+ in a bit.
To prevent the possibilities of a 51% attack, especially in the early days, Rootstock includes federate checkpoints for PoW mined blocks. Federated checkpoints are signed by the Federation members and clients can use the majority of the signatures to better decide which is the best chain.
Despite all these measures, if the Rootstock mining power does go below 5% of Bitcoin’s hashing power, then the Federation gets the authority to create signed blocks. Also, if Rootstock hashing power exceeds 66% of the maximum BTC hashing difficulty, then the users will stop using the federated checkpoints.
One of the main aims of the Rootstock founders is to incentivize merge-mining via the Rootstock network. However, they have come up with a lot of back up solutions (as have been discussed above) if in case merge-mining falls short.
So, since we have brought up the DECOR+ protocol, let’s look into what it means and how it works.
What is the DECOR+ Protocol?
As we have discussed, Rootstock uses the DECOR+ block reward sharing scheme to reduce competition and allow miners late switch to the Rootstock best block.
A lot of times in Bitcoin, two or miners simultaneously come up with the right block to add to the blockchain at the same height. Obviously, the rest of the network would ideally want to choose the same block in order to avoid any kind of dissension.
According to the Rootstock whitepaper, “The ideal solution would incentivize the miners in conflict to choose the same parent also, and DECOR+ sets the right economic incentives for a convergent choice, without requiring further interaction between miners.”
To put it simply, DECOR+ is a reward sharing mechanism which helps in effective conflict resolution such that:
- The conflict is solved deterministically. Meaning, given the same information, all the parties involved will arrive at the same conclusion everytime
- The chosen resolution is the one that maximizes all miners revenue, both for miners in conflict and for the rest
- Solving the conflict takes little to no time.
Rootstock uses the same mining infrastructure as Bitcoins for its mining purposes. This increases the incentive for merged mining because RSK pays additional transaction fees. At the same time, it becomes a lot more expensive to attack the network with pump-and-dump schemes or parallel chains. Rootstock utilizes multiple protection points to prevent attacks:
- RSK clients expects checkpoints signed by the Federation members. In order to make the platform a success, the nodes will use these federated checkpoints to detect Sybil attacks and inform the concerned user.
- Each mined coin has a 24 hours maturity period which is slightly higher than in Bitcoin. This increased maturity period reduces the power of the pump and dump attacks.
- The checkpoints are embedded in the source code.
Obviously, with a project like Rootstock which has such important functionality and so many individual elements involved, governance is a big issue. Their governance model wants to represent all the actors of the community by providing a board of governance which has 5 seats:
- 1 vote for the miners who will be able to vote with their hashing power
- 1 vote for Bitcoin and Rootstock users who will vote with Proof of Stake
- Exchanges and web wallets will have 1 vote which they will deliver via the Federation
- 1 vote for the Rootstock and Bitcoin Core developers will have a special threshold voting system
- For the last vote, it will be offered to a non-profit established Bitcoin institution, such as the Bitcoin Foundation, which may represent the largest ecosystem. An institutional vote may also be offered to the Ethereum Foundation, if it is representative of the Ethereum community.
AWS Infrastructure For The Blockchain
RSK is also working on an infrastructure framework that is built on top of RSK smart contracts and enables AWS-like services to be built and used from the development community. This network will be named “RIFOS” and will use a token called the RIF token (Rootstock Infrastructure Framework).
So why does RSK need this?
Turns out that no developer wants to build their own compute engine, a storage layer, naming service every time they are thinking to develop an app. This is one of the main reasons why it is very difficult for dApps to actually deliver on their promises.
RIFOS will basically take care of all that for the developers so that they can focus on creating their own Dapps and not figure out anything else.
This is one of the major areas where the decentralized world is still lagging behind the centralized world. In the centralized world, tools like AWS, Google Cloud etc. take care of all the things that an app will use from the developer and allow them to focus on the product they are building.
That is exactly what RIFOS is going to bring into the blockchain dev community. RIFOS will empower developers to create Dapps on top of the Bitcoin blockchain by consuming ready-made services for data storage, name resolution, oracles and payments.
So, what are the main features of RIFOS?
- These decentralized infrastructure services will be fueled via the RIF token
- This “dev stack” will be open to anyone who wants to become a provider of these services
- The smart contract engine will be compatible with Ethereum
- All these components which run smoothly and integrated on top of the RSK Smart Protocol while protected by the security of the Bitcoin Network
- RIFOS will allow developers to build services and then provide them to Dapp developers
Scalability via RSK
One of the best features of RSK is that it will scale Bitcoin beyond its current state. Let’s look consider the following facts:
- An RSK payment needs just a fifth of the size of a standard Bitcoin payment
- The block payload per time interval is 8 times higher than in Bitcoin
- RSK will provide several user-selectable signature schemes: ECDSA, Schnorr and Ed25519. Ed25519, in particular, has a much better performance than Bitcoin ECDSA curve.
- Assume that all things are equal, an RSK transaction consumes on an average 50% less bandwidth than Bitcoin, since blocks do not contain transaction data, but only references to previously known transactions.
- RSK can also reduce storage and bandwidth usage by further using probabilistic verification and fraud proofs.
Fast payments and low-latency-network
At the beginning of this guide, we told you that RSK will help with near instantaneous payments. To achieve this, several solutions are being developed:
- Using competition-free block selection
- USing hub-and-spoke network models
- Using high PoW block production rates.
What is the Hub and Spoke Model?
The hub and spoke distribution network is a system where various networks are distributed like a wire wheel where traffic flows through the spokes connected to the hub in the center. It adds new centralization nodes and requires a complete adaptation of client wallets to a new, completely different payment model.
RSK also uses the DECOR+ and FastBlock5 protocols, which allows super fast block rates and it does not create incentives for mining centralization, is selfish-mining free, and incentive compatible.
Comparing RSK With Other Parties
The following table has been taken from the Rootstock whitepaper.
RSK has no plans of doing an ICO, however, they have raised $1m in seed funding to support its development.
One of the main players during the funding was Bitcoin mining company Bitmain Technology, who led the round. RSK also drew support from bitcoin and blockchain focused investment companies Coinsilium and Digital Currency Group (DCG).
Rootstock is easily one of the most important projects out there right now. As CEO Diego Gutierrez Zaldivar puts it, “Our idea is to leverage everything that has been built by the community so far. Not only on the network effect of bitcoin, because the miners will have an additional revenue stream by merge-mining Rootstock, but by providing Ethereum developers a place to build their applications.”
The project is definitely ambitious, but we hope that they fulfill all their goals. They definitely have the team and industry support required to pull this off.
Be sure to check out and apply for the Rootstock Scholarship!